iphone

How can you determine if a file exists within the app bundle?

Sorry, dumb question number 2 today. Is it possible to determine if a file is contained within the App Bundle? I can access files no problem, i.e., NSString *pathAndFileName = [[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"]; But can't figure out how to check if the file exists there in the first place. Regards Dav...

How to save a stretched image ?

Hi, How can I save a stretched image? I have a small(50 X 50) image, that I have stretched while displaying it on a UIImageView (by choosing scaletofit mode.) Now I need to fetch & save that stretched image. I have tried by using UIImageView's image property, but it gives me original image not that stretched image. So, do...

Drawing a CGLayer outside the method drawRect: faster?

I'm not really sure, what am I asking... ...but if make layer composites in separate methods, and draw them to the view also outside of the drawRect: method... ...then could my app performance get raised? I'm actually subclassed a puzzlePiece:UIView class, where the puzzlepiece gets rendered, but the redraw invoked now with setNeedsDis...

UITextBox Height

Hi Guys. I have a question about altering the height of a UITextField. I have already made the object in Interface Builder and the height is fixed as 31. I have searched around on the net and this doesnt seem to be a popular thing to do. link to apple dev page Regards @norskben. ...

Best guide to learn to develop iphone & touch apps

Hi! I already know some Objective-C and Cocoa and I like to develop apps for the iPhone since I'm a massive iPhone user :) What's the best guide you have find yet? Or book.. Thanks a lot! ...

How to figure out the html color of an Interface Builder Color

I need to take the neat IB Color I have chosen for my background, and figure out the html color code so I can call it in the css declarations in the UIWebView content NSString. Easy way of doing this? http://screencast.com/t/M2E3MmI5Yj ...

Core-Data: Want to persist new web xml stuff to my data store rather than replace existing

Hi guys, I have an application that loads core data, then calls the XML Web Service to get updated data. I basically want my app, rather than to erase all the data and load everything (including new) to persist, I want it to add only the new stuff onto the existing stack (without duplication). What's the general consensus strategy for ...

dismissModalViewControllerAnimated doesn't always work?

Hi, What prevents a modal view controller from being dismissed? I've found dismissModalViewControllerAnimated doesn't always work? For example this won't work: SettingsViewController* settings = [[SettingsViewController alloc] init]; UINavigationController *settingsNav = [[UINavigationController alloc] initWithRootViewController:sett...

How to add a UIScrollView to a UIAlertView

I want to have a UIScrollView that is inside of my UIAlertView. Code would be greatly appreciated. ...

How to present a UIScrollView Modaly

I want to present a modal view with a UIscrollView as the content of the view. How would I do this? ...

Overreleasing here?

I have been getting EXC_BAD_ACCESS on some devices in ad hoc beta for my app see here: http://stackoverflow.com/questions/2024266/help-debugging-iphone-app-excbadaccess I have managed to use atos -arch armv6 -o myapp.app/myapp 0x000037a6 in terminal to track down the method that's causing this problem, and it's lead me to this piece of...

Background Upload

Hello all, I am looking for a direction on a background image upload on the iPhone, background meaning in my app while other interface items are processing and views are changing. I was thinking that there would be a way in the appDelegate to spawn a process to upload the file, then have a delegate return the status. Has anyone seen ...

storing regexkitlite matches by by the group instead of the occurance

Hello, I'm not sure if there is away to do this but it doesnt hurt to ask i'm using regexkitlite to create a iPhone app. Im specifically using the Regex lib to parse some html. My question is in a regular expression such as @"<a href=([^>]*)>([^>]*) - " each match in between the brackets can be placed in an array using NSString *r...

Chipmunk collision detection

Hello, I am completely new to chipmunk and I have just been using it for a few days, so I'm guessing this is something pretty obvious, however I cannot find any documentation for this. Is there any callback or method in chipmunk that tells you that 2 given shapes have collided?. If not is the best way to simply use cgrectcontains on th...

Core data / NSFetchedResultsController error

I'm having some trouble with core data / NSFetchedResultsController. I'm not entirely sure where the error is as the message is quite vague. I have an issue with inserting more than one object when the fetched results controller has no objects fetched. The following code will crash with the following error if I try and insert several o...

Chipmunk conditional collision on velocity?

Hello, I am doing a game with cocos2d and using chipmunk to manage the physics. What I would like to achieve is what pretty much every nintendo game does that your character may jump and rest in a higher floor (collision shape) without causing a collision as long as the velocity is positive, and that once the velocity is negative the co...

scale Image in an UIButton to AspectFit?

I want to add an image to a UIButton, and also want to scale my image to fit with the UIButton (make image smaller). Please show me how to do it. This is what I have try, but it does't work: Add image to button and setContentView [self.itemImageButton setImage:stretchImage forState:UIControlStateNormal]; [self.itemImageButton setCont...

Unexpected number printed for CLLocation.coordinate.latitude

I have an NSLog statement in my -didUpdateToLocation method which prints the latitude of my location as expected: NSLog(@"%g", newLocation.coordinate.latitude); prints 37.3317 In the same method, i assign newLocation to a CLLocation instance variable for use elsewhere. self.selectedLocation = newLocation; But when i NSLog this usin...

AVAudioPlayer not releasing memory

I initialize an ivar AVAudioPlayer variable, play and the try to release its memory. After the release line, it doesn't set to 0x0. After the nil line it doesn't change to 0x0. Does AVAudioPlayer require something special to release its memory? audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: [[NSBun...

Make a website adaptable for iphone

I am owning some websites, in php, java and html coded. I want them to be viewed comfortably using iphones. ie, the site has to first check whether the site is hit from a pc or mobile (iphone). If its from a mobile, it has to be redirected to another server which loads the mobile view. Some sites i've recently found of doing the same is ...