Objective-C (aClassName *)

后端 未结 3 985
迷失自我
迷失自我 2021-01-28 21:46

I\'m a kind of self-programmer-made-man, so I\'m missing some basic knowledge from time to time.

That\'s why I\'m unable to really define well the topic of my question,

3条回答
  •  后悔当初
    2021-01-28 22:28

    thats simply mean casting the object to type of the class inside the brackets for example here we cast the defention UITableViewCell to CustomCell

        CustomeCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        cell = (CustomeCell*)[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    

    ... class methode is a different somthing its function that you can call without need to define an instance of the class ... when you call a instance method you need to do like this

    Class *obj = [Class alloc] init];
    [obj funtionName];
    

    in Class ethod you just do like this

    [Class funtionName];
    

    hope this will be helpful.

提交回复
热议问题