Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Im having a expected identifier error at this line. on class A.h -(void) classADidReceiveData:(NSArray *array); Commented Apr 9, 2012 at 3:37
  • 1
    I'm also having an unknown type name at @property (nonatomic, assign) ClassADelegate *delegate; Commented Apr 9, 2012 at 4:03
  • Sorry, edited the answer. For expected identifier, change protocol 'ClassADelegate' to protocol 'ClassADelegate <NSObject>' and for unknown type name, change property (nonatomic, assign) 'ClassADelegate *delegate;' to property (nonatomic, assign) 'id<ClassADelegate> delegate;'. I'm now working on android and confused with Java interface :-/ Commented Apr 9, 2012 at 6:37
  • Thanks! @protocol ClassADelegate <NSObject> -(void) classADidReceiveData:(NSArray* array); @end still have the expected identifier error. Thanks! Anyway im form android coming to xcode. Usage is so different. Commented Apr 9, 2012 at 7:17
  • 1
    It's nice to here it helps. Anyway, I'm sorry for the expected identifier error. cA.delegate = self; assigns a ClassB instance to the ClassA's delegate property, so that in fetchedData: ClassA's instance can call ClassB's classADidRecieveData: impelmentation. Commented Apr 9, 2012 at 15:40