Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shikha123

macrumors newbie
Original poster
Apr 21, 2009
8
0
Hi! I am developing a TCP application with an iphone as a client and the MAC as a server. I am having a problem with an object of type NSMutableArray where I am getting a warning:
'NSMutableArray may not respond to '-selectedObjects'

My code line is:
NSNetService *remoteService=[[servicesController selectedObjects]lastObject];

Would appreciate some help for this.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
I am having a problem with an object of type NSMutableArray where I am getting a warning:
'NSMutableArray may not respond to '-selectedObjects'

My code line is:
NSNetService *remoteService=[[servicesController selectedObjects]lastObject];
NSMutableArray has neither a selectedObjects nor a lastObject method.
 

shikha123

macrumors newbie
Original poster
Apr 21, 2009
8
0
Thanks a lot for your reply.So, what should I use instead of NSMutableArray?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Well you're calling selectedObjects on servicesController but servicesController doesn't know that method. What is servicesController declared as? What are you trying to do?
 

shikha123

macrumors newbie
Original poster
Apr 21, 2009
8
0
servicesController is an NSArray.It is used to store the names of the servers found on the local network. Actually, in my program the iphone is the client which sends the information to MAC which acts as a server. Both are on a Wifi network

Thanks!
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
servicesController is an NSArray.It is used to store the names of the servers found on the local network. Actually, in my program the iphone is the client which sends the information to MAC which acts as a server. Both are on a Wifi network
NSArray has no selectedObjects method.

And the rest of that post is more an explanation of what you have and not really what you are trying to do. For example, why do you think you need to call selectedObjects? What is the purpose of that?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.