iphone

TextFieldDelegate being deallocated too early

My program is crashing because my TextField is sending messages to its delegate after the delegate has been deallocated. I have an object that serves as a UITableViewDataSource and a UITextFieldDelegate. In cellForRowAtIndexPath, I create a TextField inside each TableViewCell and assign self as the TextField's delegate. When I click a bu...

Is there a good HTML template engine in cocoa touch?

In my iphone app, I want to populate UIWebView with some html generated from a templates. Is there a good opensource template engine library for cocoa touch like jinja or smarty? ...

How to use back slash in NSURL

Hi, I am trying to call a web service on iPhone as follows; NSURL *url = [NSURL URLWithString:@"http://DOMAIN\Username:Password@IPAddress/ServiceName"]; When this line is executed url is nil. But when i remove "\" from above call, url contains the value. I have already tried using "\\" but it didn't worked. Here is my code NSSt...

iPad/iPhone - NSString drawInRect not word wrapping

I'm using the following to render some text in a UIView. - (void) drawRect:(CGRect)rect { NSString* text = @"asdf asdf asdf asdf asdf asdf asdf"; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]); CGContextFillRect(context, rect); CGCon...

Active vibration

IS it possible to active vibration from code ? ...

iPhone and data geolocation accuracy

Hi everybody, I'd like to develop an iPhone app that must that locate the user in a museum then popups some useful information about the sculpture he is looking at. Thus, these questions came to my mind: How accurate are the longitude and the latitude values ? Because I want to give to each place in the museum this couple of values s...

UITableView loads data too early... or too late

I have a UITableView that changes its data very often. (It's just NSStrings, stored in an NSArray.) Method 1> [self loadMyArray]; Method 2> [myTable reloadData]; Where would I put those 2 methods... so they get called EVERY time the view is displayed? I assume some likely places would be: viewWillLoad viewDidLoad viewWillAppear vie...

iPad Startup Screen Shrinks

I'm trying to get an iphone/ipad app startup screen set up. Currently on the ipad it shows the correct large version then switches to the smaller iphone image. Any ideas on why this would happen? In my plist file I have the UILaunchImageFile~ipad set up as iPad and the image files are iPad-Landscape.png and iPad-Portrait.png. They ar...

CGPDF iPhone/iPad memory problems

I've been struggling for ages trying to make a working PDF reader for iPhone/iPad, but the thing just won't stop eating memory. It seems that all the pages drawn with CGContextDrawPDFPage are cached internally and never released. I'm not the only one with this problem: http://lists.apple.com/archives/quartz-dev/2010/Apr/msg00025.html ...

UIScrollView with Paging

Hi , I am struggling with a problem related to uiscrollview.I need to load 3 images simultaneously into a scrollview like the attached image.If there is only one image the then that image should be shown centrally .If there are two images then first image should be shown centrally and half of the next image should be shown right to it.I...

How to add a new line character to a string using a custom font in cocos2d?

How do you add a new line character to a string when using a custom font in cocos2d? I have my atlas font and i tell i put the new line character into it and then tell it what font to use. CCBitmapFontAtlas *text = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Something\nSomething else " fntFile:@"generic_font.fnt"]; In the .fnt fil...

iPhone - initialising variables using self

So, let's say you have a local variable NSArray *myArray declared in your class header file. You then write @property (nonatomic, retain) NSArray *myArray also in your header file. In your .m file, you write @synthesize myArray. All very standard so far. You now have a variable myArray, which can be accessed through setters and getter...

Custom tabbar below navigationcontroller issue iphone

Hi all, I have created a custom scrollable tabbar [scrollview with buttons over it] below navigationcontroller. I have two tabbars already in standard tabcontroller at the bottom. For the standard bottom tabs, I have created two navigationcontrollers in xib with two different nibs for both. I'm loading a tableview in one of the lower ta...

[NSConcreteData scale]: unrecognized selector sent to instance when accessing an image property

Hi, I've a problem when I try to access the image property of one Core Data Model: #import <CoreData/CoreData.h> @class IngredientWithQuantity; @interface Cocktail : NSManagedObject { } @property (nonatomic, retain) UIImage *image; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * desc; @prope...

making the searchbar to stay on the top

hi, Is it possible to change the iphone contact application kind of screen to have the searchbar staying on the top always ? if yes how ? ...

UITableView background with alpha color causing problem with UITableViewCell

Hi everybody, I'm trying to get a semi-transparent uitableview, with this color [UIColor colorWithRed:(247.0/255.) green:(151.0/255.0) blue:(121.0/255.0) alpha:0.38]; It's ok if there are only empty cells, but when a cell has content inside, the background turns more solid. It's as if the cell itself had the same table background, so ...

iPhone [email protected] not showing in Retina display

For some reason, the iPhone 4 refuses to display my high resolution icon file. I've checked out these solutions, none of which have worked for me: http://stackoverflow.com/questions/3389160/how-to-setup-normal-icon-for-iphone3-and-retina-for-iphone-4 http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html http://appworks.radeec...

Removing time components from an NSDate object using Objective C/Cocoa

Hello geniuses, I'm trying to write a simple function using Objective C that accepts an NSDate object and returns an NSDate object that contains the same date value but has removed any time components from the date. For example if I were to pass an NSDate with a value of '2010-10-12 09:29:34' the function would return 2010-10-12 00:00:...

NSArray Memory-Management Issue

Hi folks, Here is my code that is being run in a background thread: -(void)updateFAQCache { NSAutoreleasePool *objPool = [[NSAutoreleasePool alloc] init]; // Grab the new plist NSMutableArray *arrLoadedData = [[NSMutableArray alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://myurl.com/"]]; // If the data is ...

Splitting one main UIView into Multiple UIViews for Sprite Drawing (Quartz 2d)

Hi all, I currently have a game which uses one single UIView to draw a number of sprites onto the screen in its drawrect method every game tic. I have been advised that for performance it would be better to separate out each sprite into it's own UIView. My questions are : Structurally how does this work ? Do I create one UIView and t...