objective-c

How do we detect if wifi becomes unavailable in iPhone SDK

Hi All, Is there any way that we can programatically identify when the wifi of a user becomes available/unavailable? My application requires exchanging messages between two different devices. It is working good in stable wifi setups. But if the wifi is unstable, I am having trouble in detecting if the other device is available or not....

How to convert cstring to NSString and NSString to cstring?

Lets say i have the following cstring char array[1000]; How i can convert it to NSString and vice verse. Thanks. ...

how to make tableview like contact apps

Hi, I want a do a tableview like in the contact apps, is it many tableView? There is a tableview controller or they just drag table in interface builder, how do you make vertical line in the cell, is it custom cell table view. That's a lot of question but juste give me the main idea to do a tableView like this? thx, alex ...

How to use id variable in objective-c?

I have an NSArray that contains two types of objects. Lets call them Apple and Orange. Apple *myApple = [self.searchQueryResults objectAtIndex:indexPath.row]; When I am building my cell's I don't know what type is in my array, apples or oranges. How can I use the generic id type to store the object, and then cast appropriately? ...

making class members properties and synthesizing them

Is it safe to say that if a class member does not need getter or setter functions then there's no point in making them properties and synthesizing them? ...

How to set "CURLOPT_USERPWD" field of libcurl in NSURLConnection

Hi, I am trying to access a web service using NSURConnection, but i am not sure how to send password there because the example code given in php is setting CURLOPT_USERPWD field of libcurl, and there seems to be no such field in NSURLConnection/NSURLReqest. ...

The problem of NSTimer

Hello All, I add a NSTimer in the iphone application。When I run the application,it‘s failed。I has tracked it and found that it stop at “0x3050c3ad <+0013> call 0x306aeaa5 ” and cann't go on in Debugger。 If you know,please tell me what’s wrong with the application and how to solve it。 Thank you! The code is: NSTimer *m_heartBeatT...

number of white spaces in string in objective-c

Is there any way to calculate number of whitespaces in string e.g "How are you?" in Objective-C? ...

Tutorial on How to drag and drop item from UITableView to UITableView

I've been banging my head on this one for a while and I figured it out. I want to give back to the community since I've gotten a lot of help from this website :). I'm trying to copy an item from one UITableView to another UITableView and information I've seen on the web regarding how to do this has been sketchy at best. I figured it out...

UITableView Cell - get IndexPath.row from button?

I currently have a button defined in a cell and a method to track its UITouchDown action as shown: - (void) clickedCallSign:(id)sender { int index = [sender tag]; NSLog(@"event triggered %@",index); } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath ...

When i play a song in my ipod and when the screen of my ipod locks the song stops automatically

Hi to all, I had created a music application and my ipod is updated to OS4.0 .When i play song in ipod and after sometime when the screen of my ipod locks the song which is being played also stops automatically which is a problem.Please anybody help me in solving this problem. ...

How to update a variable in one class from another?

I need to set a variable in Class A from Class B. To test this, I have a while loop running in Class A that continuously prints the variable via NSLog. However, no matter what I try, I cannot get Class B to update the variable in Class A in such a way that Class A can read the changes made by Class B. I am pretty sure I have everything h...

What actually is a @selector?

There are some functions which take as an argument @selector(methodName). I used NSLog to find out what @selector is, and it returns an integer. It looks like a PID, but when I ran ps ax that PID could not be found. What does that integer represent and why do we have to use @selector all the time instead of just passing the method name? ...

form load in cocoa

hi all, I want the date shown for when the form is loaded ,what can i do? NSDate* now = [NSDate date]; NSDateFormatter * f = [[NSDateFormatter alloc] init]; [f setDateFormat:@" EEEE YYYY/MM/dd "]; [date_en setStringValue:[f stringFromDate:now]]; i want to display this in window but not in the buttons a...

UINavigationBar height and landscape mode

If I use a UINavigationController to display my UINavigationBar, this bar is much slimmer in landscape mode than in portrait mode. Everything fine so far, as I want this behavior, but I have one view which isn't handled by an UINavigationController and so I just dragged and dropped a UINavigationBar from Interface Builder into the view...

using PHP in iphone

Hey friend as you know I am new in iphone I didn't know any think about can anyone help me. Can I use PHP in iPhone for storing music file And get get this file again when ever I need this any one who can help out this condition or give some hint to solve this Previously I also put one question about this.But it is with the cloud serve...

IPhone - MKReverseGeocoder - how to make sure I have the result back

Hi, what i'm trying to reach is to display annotation with the city name. So I have a class MapPoint : @interface MapPoint : NSObject<MKAnnotation,MKReverseGeocoderDelegate> { NSString* title; NSString* cityName; CLLocationCoordinate2D coordinate; MKReverseGeocoder* reverseGeo; } @property (nonatomic,readonly) CLLocat...

Animations taking extra memory

Hi all, I need to use animation in my iPad application.When I use the animations the memory is increasing and getting exception..When I launch my application the size of the memory is 10 mb, once the animations are started it is increasing the memory size upto double of the launch space (it is 30 mb). I test for the allocations and leak...

Setting Up OpenGL ES 2.0 Textures

Hi everyone, I'm working on an iPhone project in Xcode 3.2.4 for which I'd like to display textures using OpenGL ES 2.0. I don't have much previous experience working with OpenGL, but so far it doesn't seem too awful. So far I've mainly been referring to The OpenGL ES 2.0 Programming Guide (gold book). Right now I've got a project base...

Synchronous way to generated web service using WSDL for iPhone

Hello, I' ve a WSDl file , please tel me how to generate the SOAP Client using it? i used SudzC website to generate the web client , but its generating Asynchronous code for me. I need some solution which generates Synchronous Web client for me. Please let me know which web site or command line tool generates the code for me. THank YO...