objective-c

WebView Memory Management

An application that I am developing retains several WebViews that are used to allow an embedded web browsing experience for some activities centralized around the application. The problem that I am having is that after several hours open and after a lot of use the views begin to build up memory. My understanding of the memory management ...

Passing variables from one view to an other .

Hello, I know this question as been asked over and over but it's still quite obscure to me, so I guess making an example with my code instead will probably be easier . I know that you can use : A global variable, ( not good practice ). Use a delegate Use a singleton Say I've got this piece of code here in my first view controller h...

AVAudio freezes AVFoundation Stream. help

i modified the AVfoundation sample code from WWDC.. the stream is working great.. but when i play audio..using AVAudioPlayer the stream freezes. with out any error messages or anything here is the AVAdudioPlayer code.. audioPlayer = [[AVAudioPlayer alloc] initWithData:data error:&error]; audioPlayer.numberOfLoops = 0; if (audioP...

Pressing Cancel button doesn't retract

Hi there, i implement an actionsheet, when press "ok" button, do these, press "cancel" go back. the "ok" button is working fine, but when i press the "cancel" button, nothing happens, it doesnt retract or do anything, just hang at the actionsheet view. below is my code: create button at nav bar: UIBarButtonItem *clearButton = [[[UI...

how do i accept and verify text field entries without using database classes?

i want to create an app in obj C that starts by accepting and verifying a locally stored username and password. can anyone please help me out wid it? ...

Using CATransition's In Three20?

I am looking to implement CATransitions within TTNavigator, I know the method openURL can take a UIViewAnimationTransition but that only gives me flipping and curling animations, but with CATransition I have access to another 8, of which kCATransitionFromRight, kCATransitionFromLeft, kCATransitionFromTop, kCATransitionFromBottom are the ...

using coverFlow in the music application

hey gays I have create the music application .But now I want to implement the coverflow in my application .And get code for coverFlow but I have problem with that .I want When ever I click on cover flow image it must flip and the particular song(uiclass ) must start or come on the screen. it like the When tapped, albums flip over just...

How do blocks differ from normal methods and functions in Objective-C?

What is the advantage of using blocks over normal methods and functions in Objective-C? I've read the documentation, but I can't find specific uses of blocks instead of other language features. I'm sure that I've missed something, so could someone explain the advantages of blocks in a simpler way than the existing documentation? ...

iphone sdk: how to connect two UIViewController??

Hi, i've got a problem: lets say i have two view controllers, firstViewController and secondViewController. The firstViewController is supposed to present the secondViewController and i also want to access a bunch of methods and properties from the secondViewController through the firstViewController. I do this by simply using the imp...

getting problem when Iam converting the NSMutableData into string in Iphone sdk.

Hi guys, I am getting a problem when I am converting an NSMutableData to NSString. - (void)downloadOutstandingFileSounds:(NSString *)urlString { NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestUseProtocolCachePo...

escape character in cocoa

Hi i'm trying to give a request to the url in iphone sdk the http method is POST. The http body contains some escape characters NSString *requestMessage=[NSString stringWithString:@"?username/u001password/u001description"]; NSMutableURLRequest *url=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://welcome.com"]]; ...

Make program wait until the rest of the code has finished loading

I want to display data loaded from a webservice but the webservice is taking a long time and the "data" is being displayed before it is loaded. How may I force it to wait? Thanks. Connection to web service NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:tmpURl]; [theRequest addValue:@"text/xml; charset=utf-8" forH...

How to reset a NSMutableString with a empty value?

NSMutableString *str = [[NSMutableString alloc] init]; Suppose str has right know a value "me". And On click of a button I want that the value of str get reset. That is the string value become nil or empty. now i am using this [myword stringWithString: @""]; but not working. ...

how to retrieve the mobile phone from the Contacts on iPhone?

Hi,everyone, I use the following code to set the retrieve the phone number in my app. CFStringRef addressBookMobile; ABRecordRef person; NSString *mobile; person = CFArrayGetValueAtIndex(people, i); addressBookMobile = ABRecordCopyValue(person, kABPersonPhoneProperty); mobile = [NSString stringWithFormat:@"%@", addressBookMobile]; T...

Specify if current thread is main thread or not

Is there any way to specify if current thread is main thread or not in objective-c? I want to do something like this. - (void)someMethod { if (IS_THIS_MAIN_THREAD?) { NSLog(@"ok. this is main thread."); } else { NSLog(@"don't call this method from other thread!"); } } ...

How to get UIKeyboard size with Apple iPhone SDK

Hi, Is there some way to get UIKeyboard size programatically. 216.0f height and 162.0f height in landscape. Following seem to be depricated. Is there some way that works without any warning in both 3.0 iPhone OS SDK and 4.0 iPhone OS SDK to do this.. CGSize keyBoardSize = [[[note userInfo] objectForKey:UIKeyboardBoundsUserInfoKey]CGR...

Play sound in iPhone sample code required

hi i wanted to play an mp3 file in one of my project but am not able to do that i have added MediaPlayer.framework but still am not able to do that, can u please give me a sample code to play mp3 or just provide me the link. I have took a UIviewsubcontroller subclass Please help me out Thank You ...

SQLite3 - Library routine called out of sequence

When running the following prepare statement for a SQLite3 db-selecct query I get a SQLLite Error 21 "Library routine called out of sequence": sqlite3 *lDb; sqlite3_stmt *lStmt; NSNumberFormatter *lNbrFmt = [[[NSNumberFormatter alloc] init] autorelease]; // Define SQL statement NSString *lSql = @"SELECT secti...

how do I observe keyboard input event while the applicaion is not actived.

how do I observe keyboard input event while the applicaion is not actived. ...

NSURLConnection in NSOperation

Hi I am writing a code that reads data from a http connection and stores in a byte array. I have written my own NSOperation class. Reference of the code is Concurrent Operations Demystified My HttpWorker class declaration is like @interface HttpWorker : NSOperation{ NSString *param; double requestCode; BOOL isLive; l...