Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-03-2010, 05:11 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 2
Default What is this code?

I'm looking at "the elements" sample code and I can't find out what this one syntax peculiarity is called. It's also quite difficult to search for.

Code:
@interface ElementsTableViewController : UIViewController <UITableViewDelegate> {
	UITableView *theTableView;
	id<ElementsDataSource,UITableViewDataSource> dataSource;	
}
What is the id<*protocol*,*protocol*> thing called? Protocols wrapped in an object?
authgeek is offline   Reply With Quote
Old 02-03-2010, 06:15 PM   #2 (permalink)
mr.
 
refreshe's Avatar
 
Join Date: Jul 2008
Location: SF, California | Melbourne, Australia
Posts: 344
Default

An object that conforms to those protocols.
So the object you assign as 'dataSource' would have to conform to the ElementsDataSource and UITableViewDataSource protocols.
__________________
appz
refreshe is offline   Reply With Quote
Old 02-03-2010, 06:58 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 2
Default

Quote:
Originally Posted by refreshe View Post
An object that conforms to those protocols.
So the object you assign as 'dataSource' would have to conform to the ElementsDataSource and UITableViewDataSource protocols.
Thanks refreshe. For some reason I had convinced myself that I couldn't put just one protocol in the angle brackets yesterday. It seems to be working fine today with just one protocol.
authgeek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 343
20 members and 323 guests
ADY, Dani77, e2applets, Herbie, JasonR, keeshux, linkmx, mer10, Monstertaco, piesia, prchn4christ, Promo Dispenser, Robiwan, sebasx, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,760
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:32 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0