iphone

Forwarding touch events

Hi, using iphone SDK 3.1.3. I want to use the alert to choose audio routes that the MPVolumeView class gives you however i want to do it via my own button. So my plan is to put the MPVolumeView (slider and button) underneath my AudioSources button so its not visible and then forward touch events from the button to a specific co-ordinate ...

Deciding on a comprehensive mobile strategy

I have an idea for a mobile application (initially targeting iPhone but would like to target others in the future) and am trying to decide the best way to package/sell the product. For lack of a better term, the app would be a "platform" that potential clients could use to create their own branded application. There will be a server-side...

Correct way to access an NSMutableArray between two UIViewControllers ?

Design question: I have ViewController A which contains an NSMutableArray*. The ViewController A is responsible for displaying the user a Map, when the user interacts with this map, the view controller A fills the NSMutableArray* with Coordinate Objects. The information contained in the NSMutableArray* should be later displayed in a ...

How to create an Array from other Array?

Is there a way for creating an array from other severals arrays, in Objective C? ...

How to remove an unsaved object from a managedObjectContext

Hi all, I'm having a problem with a Core Data project on the iPhone. The scenario occurs when a user starts to add an object, then cancels during the process. If the user hits cancel and returns to the list of objects, a dummy object is listed there, representing the one they were in the middle of creating. This is never saved to the ...

What is leaking in this statement using replaceObjectAtIndex

Instruments tells me the following line from the code below is leaking: I can't figure out how to fix this leak. [self.selectedElement.usrAdvancedBuyingPercents replaceObjectAtIndex:selectedRow withObject:[numberFormatter stringFromNumber:percentage]]; - (IBAction) simpleMarginSliderValueChanged:(UISlider *)sender { NSDecimalNumber...

Is it worth waiting a couple of milliseconds on a TextChanged event?

I have a textfield for a filter customers action on a mobile device. I am wondering if I should wait for a few milliseconds before launching my code when the user typed in less then 3 chars, and only execute the code if the text is longer or equal than 3 chars. The executed code takes longer(sql like syntax on a larger database), and th...

Scroll table to top causes crash

I've tried: - (IBAction)openSearch { [tblSimpleTable scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES]; [searchBar becomeFirstResponder]; } and - (IBAction)openSearch { [self.tblSimpleTable scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; [searchBar...

iPhone Core Data "Production" Error Handling

Hi there, I've seen in the example code supplied by Apple references to how you should handle Core Data errors. I.e: NSError *error = nil; if (![context save:&error]) { /* Replace this implementation with code to handle the error appropriately. abort() causes the application to generate a crash log and terminate. You should not use ...

iPhone OpenGL Texture loader issues

Ok, what I'm trying to achieve is to load an image as a single resource and then save different parts of it as a number of different textures (basically chopping the image into smaller squares and then saving them separately). For my game, simply mapping different sections of the original image to my shapes won't work and being able to ...

Activity indicator (spinner) with UIActivityIndicatorView

I have a tableView that loads an XML feed as follows: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; if ([stories count] == 0) { NSString *path = @"http://myurl.com/file.xml"; [self parseXMLFileAtURL:path]; } } I'd like to have the spinner to show on the top bar at the app launch an...

push multiple views from TableView to Tableview

Hi Out there, my app looks like this UINavigationController with UITableViewcontroller as RootViewController. feedsTableViewController = [[ablogFeedsTableViewController alloc] initWithStyle:UITableViewStylePlain]; feedsNavigationController = [[UINavigationController alloc] initWithRootViewController:feedsTableViewController]; feedsNav...

Failed Attempt to use Perspective Transformations in Core Animation

I'm trying to create a simple iPhone app that displays a picture with a reflection beneath, and I want to rotate the picture around the X axis, using Core Animation. I've started by creating a new iPhone app using the "View-based Application" template. I added a "Picture.jpg" image file, and then I added this to the view controller: -...

How to reference a subview without outlet

Just beginning with iPhone development i seem to miss something fundamental. In a View based application i'm adding programaticaly a UIView subclass in the ViewController implementation file and can set a value: - (void)viewDidLoad { [super viewDidLoad]; CGRect myRect = CGRectMake(20, 50, 250, 320); GraphView *graphView = [[Gr...

Bookmarks access iPhone SDK

Hey guys, how do you access bookmarks with the sdk? I'm currently making a browser of sorts for iPad. I made the address bar and added the bookmarks button but I don't see any documentation on accessing bookmarks. Basically, I would like to know how to access Safari Bookmarks. Anyone know how to do this? Cheers! ...

Should I put my UITabBarController outside the App Delegate?

Hi guys, I followed an example from "Beginning iPhone 3 Development" which puts the code for the main view controller, a Tab Bar, in the delegate method. Is this the correct place to put this or should it be in a separate .h and .m file? All my subviews are in separate files so I'm wondering if I should have my tab bar view controller ...

CGContextSetShadow produces no results

I'm using this code in my UIView subclass to draw a circle with a gradient fill: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetShadow (context, CGSizeMake(4,4), 5); CGContextBeginPath (context); CGContextAddEllipseInRect(context, CGRectMake(self.bounds.origin.x, self.bo...

what is the different between "view" and "window" on iPhone?

I use the Xcode and add a UI elements on that, but there have different XIB that I can choose from. there are application XIB, view XIB, and window XIB. I want the user tap, and go to the next screen. I don't know which UI element is suitable for my "next screen", I means, whether I choose the View XIB or a Window XIB? ...

CGPathContainsPoint question?

this is in GameViewController.m -(void)fillMutablePath{ CGPoint movePoint = CGPointFromString([pointsToFillArray objectAtIndex:0]); CGPathMoveToPoint(fillPath, NULL, movePoint.x, movePoint.y); for (int i=0; i<[pointsToFillArray count]; i++) { CGPoint tempPoint = CGPointFromString([pointsToFillArray objectAtIndex:...

iPhone SDK Invert the Colors of a UIImage

Hey everyone I've got an iPhone app that allows a person to draw something on the screen with their finger. They draw with a white line on a black background. However, when I upload this image to the web server, the line itself is white. I have been trying to work through the core graphics libraries in search of a way to invert the colo...