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.
 
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.
 
Thanks a lot for your reply.So, what should I use instead of NSMutableArray?
 
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?
 
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!
 
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.