cocoa-touch

Where to store label font information - in the Model or the View?

What is the best practice for storing font information of labels in Cocoa-Touch following the MVC paradigm? In my data model I would like to store information that are displayed by a custom view as UILabels. It is evident that the label text belongs to the data model. But where should I store the corresponding font (and in my situation ...

Writing temporary files in iPhone app

Hi, I am just curious about what is the behavior of temporary directory in an iPhone app. (If my memory is correct there is a tmp directory in the same location as Documents) What happen if I save some files there?, would they be deleted automatically when my app is terminated or should I do it manually? in that case What would it be t...

Problem : UIScrollview bouncing makes Parent UIScrollview bouncing

I have a fullscreen UIScrollview(B) in a fullscreen UIScrollview(A). A has a contentsize = number of page Horizontally B has a contentsize = number of Subpage Vertically Inside B , I have a small UIscrollview (C) that scroll in the same direction than B... So vertically too. When C is wildly scrolling, it creates a hard bouncing eff...

Unit testing and iPhone development

I'm currently using OCUnit that ships with Xcode 3.2.4 for doing unit testing of my application. My workflow is often to set some break points in a failing unittestin order to quickly inspect the state. I'm using Apple's OCUnit setup: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/135-Unit_Test...

locationServicesEnabled always return YES

I tested my device (iPod Touch 2G iOS 4.1) if location services are enabled permitted = [locationManager locationServicesEnabled]; and I always get a YES whether location services are enabled or not. I'm talking about the general button for location services and not the app specific button. On iPad with iOS 3.2.2 everything is working...

Setting contentOffset of UITableView in UIViewController viewDidLoad method doesn't take effect...

UITableView setting contentOffset in UIViewController viewDidLoad doesn't take effect... - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; self.tableView.con...

Does NSArray initWithObjects: retain objects?

When adding objects to an NSArray using "initWithObjects" can anyone confirm for me that the items are retained. I am pretty sure they are, but can't find it mentioned anywhere with regards to initWithObjects? // CREATE DRINKS Coffee *drink1 = [[Coffee alloc] initWithName:@"Flat White"]; Coffee *drink2 = [[Coffee alloc] initWithName:@"C...

iOS: How can one use custom fonts in UIWebView?

How can one use custom fonts via @font-face in a UIWebView? I know that it's possible to use CGFonts to render custom fonts on the iOS, but in my specific case I need the font to render inside a HTML document within a UIWebView. Is this possible in any way? ...

How do I create a UINavigationController with a default "back" state?

I have a UINavigationController, complete with table view and associated magic. The data I'm populating that table view from may have items from multiple categories, but the default view for the user will be one in which they are viewing all of the items, and then they have the ability to move backwards to a different table view that wo...

Xcode: iPod Touch Simulator?

Hi, I'd like to test my app on the ipod touch. But in Xcode I don't see a simulator for this (I only see a simulator for iphone 3gs, iphone 4, and ipad). Do you know if there's a way to run an ipod touch simulator? ...

Using KVC to find the maximum value in an NSSet

Hi all. I'm trying to find the maximum value in the order property in this coredata object: #import <Foundation/Foundation.h> #import "Story.h" @class Story; @interface Sentence : NSManagedObject { } @property (nonatomic, retain) NSString *text; @property (nonatomic, retain) NSString *image; @property (nonatomic, re...

How to put text on different lines in a table cell

In a table cell I tried putting "\n" in the text, but this doesn't put the text on a new line it just puts a space in between the text. ...

How to embed a Youtube video and Podcasts into an iphone app.

I have an app which requires the Youtube videos and Audio Podcasts to be played inside my app and not giving out control to youtube player or safari. What is the method that can be used to embed Youtube videos and Audio Podcasts into my iphone app? Any tutorials about the above issue are most desirable as I am new into this. Please gi...

How do I check for an error after [NSData dataWithContentsOfMappedFile:]?

I have this code in my project: id mappedData = [dataWithContentsOfMappedFile: path] Obviously, if mappedData is nil it didn't succeed. But how can I get details about why it didn't succeed? There's no dataWithContentsOfMappedFile:withError:. ...

How can I add the following extra linker flags?

To support OS 3.x, please set Base SDK to iPhone Device 4.0 and iPhone OS Deployment Target to iPhone OS 3.x. Extra linker flags may be needed if NSConcreteGlobalBlock and UIBackgroundTaskInvalid runtime error occur under 3.x. The linker flags are: -weak_framework UIKit -weak_library /usr/lib/libSystem.B.dylib EDIT: im still getting th...

The 'rootViewController' outlet of UIWindow is not available on releases prior to iOS 4.0

I am getting the following error on pre-iOS 4.0 builds: The 'rootViewController' outlet of UIWindow is not available on releases prior to iOS 4.0. Remove the connection and instead programmatically add the view controller's view to the window after the application finishes launching. How and where do I do this programmatically? ...

Implementing Contact Form Like fuctionality to send Emails from iphone app

Hi, In my app the functionality required is similar to "contact form". I want that user should be able to send email to me using that contact form. Now the form should contain textFields for Subject and Message Body but the Recipient Email Address should be pre-fixed and should not be shown.As I dont want to disclose my email id to all...

Search component effect in the mail application

Hi, In the iPhone email application once I click on the search bar it shifted to top and the background gets black. How to achieve this type of effect in the code? Do we need to create a custom UIView and make this shift explicitly? ...

Resources seem not to be copied to iPhone

I've created a prototype app which uploads a bunch of photos to a webserver. Everything works fine in the simulator. But when I want to try it on an actual device it does not find the images. I've included them under the resources group in Xcode. Anyone? Best –f ...

iphone - How to tell which view is currently loaded in a tabBar app?

Here is my scenario. I have 3 out of 4 tab views that contain UIWebViews and UIImageViews. I have the UIImageView on top of the webView to provide a loading image and I remove the imageView when the delegate method webViewDidFinishLoad: is called. This works just fine. The problem I am running into is trying to handle the method web...