Questions tagged [objc-protocol]

11 questions
25
votes
4 answers

What are the angle brackets "<…>" in an Obj-C class interface for?

Can anyone tell me what the angle brackets <...> in an Objective-C class interface do? Like this one (from http://snipt.net/robhawkes/cocoa-class-interface): @interface MapMeViewController : UIViewController
robhawkes
  • 305
  • 1
  • 4
  • 10
16
votes
4 answers

Type 'ViewController' does not conform to protocol 'UICollectionViewDataSource'

I am following a tutorial where using the UIPickerController to operate the camera. However when implementing UICollectionViewDatsaSource, I get an error saying that ViewController does not conform to the UICollectionViewDataSource protocol. class…
RPMouton
  • 161
  • 1
  • 1
  • 6
9
votes
1 answer

Using self in class method

I came across this code in ShareKit, and I don't understand what the writer had in mind, using self in a class method. There is a warning: Incompatible pointer types sending 'Class' to parameter type id. I want to clean up these…
Jim
  • 5,940
  • 9
  • 44
  • 91
9
votes
1 answer

Can anyone give example of forward declaration in objective C for a normal class and not for category or protocol?

Can anyone give example of forward declaration in objective C for a normal class and not for category or protocol?
Prabh
  • 2,466
  • 2
  • 24
  • 27
5
votes
2 answers

Auto Property Synthesis Warning in Xcode 5 iOS 7

I'm getting a warning in Xcode 5 with the iOS 7 SDK that says Auto property synthesis will not synthesize property declared in a protocol I didn't get this warning in Xcode 4 with the iOS 6.1 SDK. Any ideas? Here is my code: List.h #import…
raginggoat
  • 3,570
  • 10
  • 48
  • 108
4
votes
1 answer

Check for optional multi-argument delegate methods

Newish to Swift. Struggling with how to get the most concise/idiomatic syntax for calling an optional delegate method if (a) the delegate is set and (b) the method is implemented. I know the ? can play this role (eg self.delegate.foo?()) but I'm…
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
3
votes
1 answer

statements in chevrons after class name meaning

In the section of code below, what exactly does the part mean and do? what would it most likely be used for and what would most likely happen if it was removed? (any theoretical example is good) @interface…
Dollarslice
  • 9,917
  • 22
  • 59
  • 87
2
votes
1 answer

objc incompatible pointer type with protocol inheritance

I am running with Xcode version 5.1, iOS SDK version 7.1. Here are some sample declarations all in the same file: @protocol A @end @protocol B @end @interface SomeObject : NSObject @end @interface SomeContainer : NSObject -…
tompitt
  • 340
  • 1
  • 11
2
votes
2 answers

JSONModel: Filling an NSArray of generic type

I'm using JSONModel in my iOS app and i'm facing some warnings, let me explain myself a bit. Let's say i have this JSONModel CTVContact.h @interface CTVContact : JSONModel @property (nonatomic, strong) NSArray
albertosh
  • 2,416
  • 7
  • 25
  • 32
1
vote
2 answers

Casting down with Objective C

Say I have a subclass of NSManagedObject called MBManagedSquare and MBManagedCircle. An MBManagedSquare and MBManagedCircle define a method prepareFromDictionary:(NSDictionary*)dic, and both of their implementations are different. Say I have this…
Snowman
  • 31,411
  • 46
  • 180
  • 303
0
votes
3 answers

Delegate doesn't work when trying to segue from UIView's button to another ViewController

I'm trying to programmatically segue to a view controller which is on another storyboard. To give more details; I've an UILabel and UIButton on my xib where UILabel contains a "Lorem ipsum" and button's type changed custom so that it can be…
t1w
  • 1,408
  • 5
  • 25
  • 55