cocoa-touch

Issue while adding 'Cc' Field in 'TTMessageController' (Three 20)

Hi All I am using the TTMessageController class for compose mail.There is only 'To' recepients Field in this class. I added the Cc Field in it. I have used this code: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { _fields ...

How to organize delegate files

In cocoa-touch development... Use AppDelegate for delegate classes Create separate delegate class and locate in new .h/.m for each class need to use delegate Use view controller classes(whenever such exist) to do that job for all classes managed by this controller What would you recommend? ...

How can I restore the back button in UINavigationController?

I have created my own leftBarButtonItem: UIBarButtonItem* homeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self a...

With and Without Dot Notation?

I am trying to write the following without using dot notation ... [scrollView setMinimumZoomScale: scrollView.bounds.size.width / image.size.width]; Is this right? [scrollView setMinimumZoomScale: [scrollView bounds].size.width / [image size].width]; cheers Gary. ...

Casting to specify unknown object type?

In the following code I have a view object that is an instance of UIScrollView, if I run the code below I get warnings saying that "UIView might not respond to -setContentSize etc." UIImage *image = [UIImage imageNamed:@"Snowy_UK.jpg"]; imageView = [[UIImageView alloc] initWithImage:image]; [[self view] addSubview:imageView]; [[self vie...

EXC_BAD_ACCESS when sending messages to blocks on 4.0 -> 3.2

I've been using http://code.google.com/p/plblocks/ for a while now to get blocks support in our 3.2 iPad app. It was recently pointed out to me that you can set xcode to use the 4.0 SDK, then set the OS Deployment target to 3.2. If I do, the following code works. void (^world)() = ^ { NSLog(@"Hello World"); }; NSLog(@"Hello?"); ...

iPhone: Core Data: Updating a pre-filled database in future app versions.

I am creating an app with a database of information that needs to be pre-filled. This data will change in future versions. In the same database, I also need to store user editable information since that user edited data directly relates to the pre-filled data. My question is, if I'm pre-filling the database by creating a duplicate data ...

Cocoa Touch - setting text of header of UITableView

Hey all, I'm trying to set the title of the header of my entire UITableView, but am having no success. For example, on this webpage: http://www.iphonesdkarticles.com/2009/01/uitableview-sectioned-table-view.html I am trying to replicate creating the "Countries" header programmatically. I have a UITableView that works and displays data....

NSNumberFormatter not honoring digit information in scientific style

I am trying to display some decimals in a scientific style. I'm using NSDecimalNumber and NSNumberFormatter objects. When setting the minimum and maximum number of digits though, some information from the original number seems to be lost. For example, consider the following code example: NSDecimalNumber *dn = [NSDecimalNumber decimal...

Can’t tap button after interface rotation

Hello! I’ve got a view that has to be presented both in landscape and portrait. The transition between different orientations is done by repositioning and resizing the subviews. One of the subviews is a button (plain UIButton with an image background). When the interface rotates to landscape, the button starts misbehaving – it can only b...

How to set html text as message body on 'TTMessageController' Layout.

Hi All, I am using 'TTMessageController' for composing mail.I want to use this class for replying mail. How I set the html Text in message body on 'TTMessageController' Layout ? Thanks Deepika ...

Problem of Sprites and labels are displayed by white boxes.

I am writing a game in cocos2d. I am using a function restartDirector in AppDelegate class. -(void)restartDirector{ [[CCDirector sharedDirector] end]; [[CCDirector sharedDirector] release]; if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ) [CCDirector setDirectorType:CCDirectorTypeDefault]; [[CCDirector sharedDirector] ...

Creating UITableViewCell programatically

I want to create a tableviewcell and add it on the view(not tableview) as CGRect aframe=CGRectMake( 20, 20, 200, 200); UITableViewCell *cell =[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; cell.frame=aframe; [self.view addSubview:cell]; But this is not working at all. Can't we create cell inde...

How do I obtain the cell data usage statistics of an iPhone using private APIs?

Hi there, everybody. I need to do an app to be distributed ad hoc (it doesn't need to go to the store) but I need to get the information about the "data usage" (gprs/3g traffic). It is available on the system, but there is no official API call to get that info. One app made it through Apple testing (it's called "Download Meter"), thoug...

Modal View Controller Undesirably Hides Tab Bar

I am working on an application that requires user authentication to access a profile. The profile section is located solely under one tab (and all others tabs do not require authentication). I currently present a authentication view controller modally (and then dismiss on success) when the user selects the profile tab. However, this appr...

Cocoa memory management

At various points during my application's workflow, I need so show a view. That view is quite memory intensive, so I want it to be deallocated when it gets discarded by the user. So, I wrote the following code: - (MyView *)myView { if (myView != nil) return myView; myView = [[UIView alloc] initWithFrame:CGRectZero]; // ...

Custom width for cell in UITableViewStyleGrouped tableviews

In the iPhone SDK, is there a way to customize the width of the cells in a tableview that is having the style of UITableViewStyleGrouped? The problem is that I am using an custom background image (width of 290px) for the cell.backgroundView but apparently that gets stretched. I want to be able to set the custom width of this cell so the...

iPhone Multithreaded Search

I'm sort of new to any sort of multithreading and simply can't seem to get a simple search method working on a background thread properly. Everything seems to be in order with an NSAutoreleasePool and the UI being updated on the main thread. The app doesn't crash and does perform a search in the background but the search results yield th...

Is drawRect: called on multiple threads when using a CATiledlayer?

I know that drawLayer: and drawlayer:inContext: are called on multiple threads when using a CATiledlayer, but what about drawRect:? Apple's PhotoScroller example code uses drawRect: to get its images from disk, and it has no special code for handling threads. I am trying to determine whether my model for a CATiledLayer must be thread-s...

How can I put the MPMediaPickerController cancel button on left side?

I'm developing an app and so far all cancel buttons have been on the left side of the navigation item. I thought this was standard and that's what Apple do with their apps. That is until I ran into the MPMediaPickerController which has it's cancel button on the right side of the navigation item. Is there anyway I can move this to the l...