Tag: iphone

How do I know if text exceeds the bounds of a text view?

I would like to know when text exceeds the bounds of a UITextView and requires the user to scroll. Knowing how many lines a certain font will occupy is useless – how do I know how many lines a certain amount of text will take up? In the image above, I would add a fade […]

Creating a new NSString instance has retain count of 3

I am trying to copy a string that is passed into a method like so: -(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { NSLog( @”elementName, %@: %i”, elementName, [elementName retainCount] ); // rc = 2 if ( currenttag ) [currenttag release]; NSLog( @”currenttag: %i”, [currenttag retainCount] ); // rc = 0 […]

How to convert FLAC file to wav file in ios?

I want to create a audio player that support Flac format of audio files.For this i tried to implement the algorithm of flac to wav conversion which is as follow Please help me. All time it gives me error ERROR: initializing decoder: FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE static FLAC__bool write_little_endian_uint16(FILE *f, FLAC__uint16 x) { return fputc(x, f) != EOF […]

Re-Installing IPhone App From Inside The App

I want to find a way if it’s possible to re-install an IPhone app from inside it? Let’s say my users have the app already installed in their phones and now new version is released, can I make my app such that it will check over internet if new version is available and if it […]

Adding address book in contact page

I want to add an address book in my contact page and I want to do that programmatically i.e without using nib files. Can anyone suggest me a nice tutorial or sample code for that. i have used the codes of the answer given by iPatel and when i am running it is throwing exception […]

AVAudioPlayer doesn't play audio in iPhone 5 when locked

Using AVAudioPlayer I’m trying to play sounds while the iphone player is playing. Also when device is locked. The thing is, that in iPhone 4s ios 7 – works fine. But on iPhone 5 with 6 and 7 ios nothing happens. In the -Info.plist in Required background modes I wrote App plays audio or streams […]

ViewController With Transparent Background Entering Current ViewController With Push Transition

I have this story board : my first ViewController has PNG image as background programatically : – (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”bgleft”]]; } my second ViewController has transparent background by selecting Clear Color as Background property on Storyboard. but when it runs on my iPod, it seems that my second ViewController […]

EXC_BAD_ACCESS when executing ABAddressBookSave !

I’m trying to create a new contact and add it to the AddressBook but when I get to the ABAddressSave line of code I get EXC_BAD_ACCESS. I cannot see what am I doing wrong, I enabled NSZombie to check if this is a memory related error but it didn’t spot any. Can anybody tell me […]

cocos2d error

I am following the tutorial http://www.bit-101.com/blog/?p=2115.In this tutorial i found a project template and go through it to begin…. I have downloaded cocos2d-iphone-0.99.1 add the subdirectory cocos2d to project….but when i built i got 9 error and 4 worning Scene.h: No such file or directory Director’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:79:24: error: FontManager.h: […]

UITableView superClass for delegate?

A quick question, I am setting a delegate for UITableView and I have a question regarding setting the delegate and dataSource properties. I have noticed that the properties for delegate and dataSource are not available, I was thinking that adopting the protocols would make them available. But I am now thinking that I maybe have […]