iphone

Is there no unit testing framework in the iphone sdk?

Is there no unit testing framework in the iphone sdk? ...

Unit Test Fails -- Why?

Hi, I have the following test in my unit test suite: STAssertEquals(0, [[newUnit itemsWithinBasketFrom:[NSDate dateYesterday] through:[NSDate dateTomorrow]] count], @"A unit with no items should return 0 when asked for items in place within a date range. (count=%i)", [[newUnit itemsWithinBasketFrom:[NSDate...

object interface layout?

Previously I used to write my object interfaces like this: // VERSION 1.0 @interface Planet : NSObject { NSString *name; NSString *type; NSNumber *mass; } @property(nonatomic, retain) NSString *name; @property(nonatomic, retain) NSString *type; @property(nonatomic, retain) NSNumber *mass; -(NSString *)description; @end Bu...

How do I set the picture in a UIImageView

I need to set an image view to display an image here. else if (n == 2) { gamestatus.text = @"The Card is A Two."; // I Need to set my imageview to a picture here. } ...

How can i change the simulator user position in Objetive-C MapKit?

I will the location update be harcoded in simulator to my real position... ...

What exactly does @synthesize do?

I have seen the following piece of code: //example.h MKMapView * mapView1; @property (nonatomic, retain) MKMapView * mapView; //example.m @synthesize mapView = mapView1 Question: What relation between mapView and mapView1 is ? Does it create set and get method for mapView1 ? Thanks ! ...

Appearance of table cells when deleting

I'm trying to make a table view with an appearance much like the default Weather application provided by Apple. However I'm struggling a bit to make the table cells look correctly. I would like all the cells, except the first one to be deletable. The problem is that the default cells have the small delete button on the left side of the ...

Why does UIBarButtonItem not show the Image on Iphone 4

I'm trying to add a reload button to my navigation bar using this code - (void)viewDidLoad { [super viewDidLoad]; UIButton *butt = [UIButton buttonWithType:UIButtonTypeCustom]; [butt setImage:[UIImage imageNamed:@"reload.png"] forState:UIControlStateNormal]; [butt addTarget:self action:@selector(reloadNews) forControl...

timeIntervalSinceNow returning negitive numbers

timeInterval keeps returning random numbers. Some positive. I would think the interval would continue increase with each call, but sometimes I get negative numbers or positive numbers. NSDate *date = groceryItem.lastPurchased; double timeInterval = [date timeIntervalSinceNow]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%d"...

addSubview does not show view on iOS 3.1.3

I have a scroll view which has one UIView inside which contains the content. I am adding a UIImageView as a sub of the UIScrollView (so it should be on top of the content container) and this works on iPhone 3.2+, but on an iPhone running 3.1.3 the image does not show up above the container. My code is something like this: // add the...

How can i get Mapkit documentation short and simple to do my current position responds a DragAndDrop events

How can i get Mapkit documentation short and simple to do my current position responds a DragAndDrop events ...

"Unable to download content from web site" while NSXMLParser initWithData

Hello, Currently I am trying to parse an xml string that I already have (no web calls needed). My app is native iPhone in Objective-C. I have set up an NSXMLParser delegate class which uses initWithData:xmlData. For some reason, the first and only callback on my delegate is to parser: parseErrorOccurred with the following text: "Unab...

How to limit my app to run only on OS 3.0 family (or earlier) and not on OS 4.0?

Hi everyone, Is there any way I can limit my app on the store to say that is only compatible with 3.0 os family and not with 4.0 ? I've been searching on the store and all the requirements are only in the form "iOS3.0 or later". Can anyone tell me if this is possible? Thanks in advance. EDIT: I just noticed that some apps on the stor...

Rotation of NIBs

I've been digging at this for a few days and can't seem to figure it out. My app launches in landscape and supports only landscape orientations. Works fine. My app delegate instantiates a root view controller, view is built from an XIB and populated with an image in viewDidLoad. The underlying image is landscape size (1024x768). Looks ...

PDFs not showing, Other URLs do.

I am having difficulty with a UIWebView which shows http URLs correctly, but not bundled .pdf files. I have also read alternative solutions such as using QuartzCore framework, however this does not seem to support multiple pages in PDFs. Here is the code that works (for google dot com) - (void)viewDidLoad { [super viewDidLoad]; NS...

Simulate iPhone 3.0 with SDK 4.0

Hi, i have xcode 3.1.3 and xcode 3.2.1 installed For sure now I use 3.2.1 with Sdk 4 to develop new apps. But what if I like to test a App compiled with sdk 4 on a simulated iphone that would just have 3.0?? As BaseSDk i use 4.0 and as target 3.0 In xcode 3.1.3 i could select a simulator down to 2.x but with sdk 4.0 i only have the o...

UITableView not updating DataSource after change to NSFetchedResultsController

I have an UITableView populated by a NSFetchedResultsController. The initial fetch works fine. I can add, remove, modify, etc with zero problems.. But I want to add user-defined sorting to the table. I am doing this by changing the NSFetchedResultsController to use a different sortDescriptor set, and a different sectionNameKeyPath. Here ...

Implementing delegate methods for modal view controller data transfer

I have a simple project to present a modal view controller and transfer back a string based on which button in the modal VC that gets pressed. I based it all on watching the Stanford class on iTunes U. It looks like I have everything correct, but I get a couple of compiler warnings. First I get one called passing argument 1 of 'setDel...

iOS 4 freezes app

Hi guys, I have an app that runs on iPad and iPhone running iOS 3.2, but when I try to install it in the simulator it freezes - unresponsive interface (a UIAlertView at this point), no console messages, no crash logged. When I step through, it gets all the way through applicationDidFinishLaunching and then stops with this list of calls:...

How do I add a custom UIMenuItem to the UIMenuController in a UITextView?

I'm trying to add a menu item next to the "copy", "paste" items in a UITextView. I've created a subclass of UITextView and copied the example from apple's docs here: http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/Text/Text.html#//apple_ref/doc/uid/TP40009370-CH8-SW28 I simply created a ...