iphone

Core Data Table View Section Sort by weekdays using NSSortDescriptor

I'm currently trying to sort my array of objects into day order so they can be grouped in the correct order i.e. Monday, Tuesday, Wednesday then by start time. Only problem is I can't figure out how to do this, my code currently looks like this: Which sorts alphabetically then by time: NSString *sectionKey = nil; switch (tab) { case k...

iPhone: Nsstring has an ó

Hey guys I have an NSString that has an ó inside, so when I put it in a TextView insted of reading "ó" I reads "A³". So this is what I did: self._Direccion = [self._Direccion stringByReplacingOccurrencesOfString:@"ó­" withString:@"ó"]; but it's not working, I don't know why... Is working for this: /* á*/ self._Direccion = [s...

iphone (objective-c) accessory modification error

hi guys I have one last problem that is killing me. I am playing around with an older project which used the tableView:accessoryTypeForRowWithIndexPath method, of which i am trying to rewrite the app without it. I have deleted the tableView:accessoryTypeForRowWithIndexPath method, but my solution isnt working just yet. The problem is ...

XMLParser delegate and memory leaks

Hi everyone I am building an application that has to handle the parsing of several different kinds of XML files. As I want to standardize the procedure as much as possible, I created a singleton class which handles the parsing of any XML data. The class is handed two options, a unique identifier telling it what kind of XML data it is go...

Scaling up iPhone "vector-based graphics" on affine transforms

I made a "Circle" view with this drawRect - (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(ctx, color.CGColor); CGContextAddEllipseInRect(ctx, rect); CGContextFillPath(ctx); } When I try to scale the view up using CGAffineTransformMakeScale(2.0, 2.0), th...

How can do I test a camera in the iPhone simulator?

Is there any way to test the iPhone camera in the simulator without having to deploy on a device? This seems awfully tedious. ...

Where is memory leak in this small function

Instruments says I have leak in this function. I am new to Obj-C so pardon for missing something obvious besides I am not sure if I am doing everything right here. (void) selectList:sender { NSMutableString *nibName = @"myController"; MyOwnController *study = [[MyOwnController alloc] initWithNibName:nibName bundle:nil]; study.title = @"...

iPhone UIScrollView / setContentOffset weirdness

Hi, I have a weird issue with setContentOffset which I don't seem to be able to solve: I'm trying to build an "endless" scroll view, so I'd like to reset the content offset at a certain position. With the code below setContentOffset will be called at x=160px. If I drag the scroll view my log looks like this: offset: 158 offset: 159 o...

Need help with writing a SQLite3 Objective-C resultset wrapper

Hi, I am trying to write a sqlite resultset wrapper class for the iPhone, and I would like to be able to dynamically call sqlite3_column_int or sqlite3_column_text? For example, in my fetchAll method, I would like to not know what exact data i'm returning, I just want to return it. My goal is to have a class that doesn't care what da...

Is there a way to create a subfolder in the resources folder in Xcode?

This might be an overly simple question, but I am a beginner at programming for the iPhone with Xcode. My project uses a lot of picture files for UIImageView animation arrays. I add all of the pictures into my resource file but the resources folder is getting a bit unwieldy. Is there a way to add subfolders in resources that do not ch...

Dismiss keyboard when user taps Mapview

I have a UITextView in my Navbar that is acting as a search box. I would like to dismiss the associated keyboard when the user taps below the text box - namely on the MKMapView. However I can't figure out how to do this since it doesn't look like I can intercept touches from the mapview. I have looked at a number of solutions, but none...

SQLLite Code works on iPhone simulator, crashes on iPad

This code works fine on the iPhone and the iPhone simulator, but crashes the simulator when running on the iPad: const char *createsql = [MYClass GetDBCreationString]; sqlite3_stmt *crts; if (sqlite3_prepare_v2(database, createsql, -1, &crts, NULL) == SQLITE_OK) { int success = sqlite3_step(crts); if (success != SQLITE_DONE) { ...

Add drop shadow to PNG using Cocoa

I have some PNGs with transparent backgrounds that I would like to add shadows to programatically. I've seen examples of adding shadows to square objects, but haven't seen any with complex shapes. So the two steps I think I'd have to do would be: Isolate the PNG shape Draw a shape behind the PNG that is blurred, faded, and offset. I...

Can two view controllers be delegates for one another?

Hi all, I'm learning objective-c and cocoa touch at the same time as building an app so I've got a fairly simple question (I think), sorry I don't have enough brownie points on the site to show a visual diagram of my site. But let me explain, I have the following Main ViewController ViewController A ViewController B ViewController C...

Why won't my UIActivityIndicatorView stop animating?

I am trying to manage the activity indicator from my App Delegate, that way any of my views can put the indicator up. So, I am adding it as a subview to 'window' and start/stop as follows: - (void)didStartActivity { if( activityIndicator == nil ) { activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicat...

Xcode property list editor shows Mac app attributes instead of iPhone app attributes. How do I fix it?

Hi. My Xcode is configured for iPhone dev, and it worked well until yesterday. But it's property list editor currently shows me Mac app's attributes for my iPhone project which includes 'Java', "plugin" and "quicklook" related items. OK, I can input them manually, but it means something wrong to my IDE, so it does not sure it works corr...

UIActionSheet with 2 buttons ....{iPhone SDK}

hi iam creating an UIActionSheet with 2 buttons . now i want two each buttons do separate work . how can i declare my 2 buttons on the : - (void)actionSheet:(UIActionSheet *)menu didDismissWithButtonIndex:(NSInteger)buttonIndex i use this code : if (buttonIndex != [menu cancelButtonIndex]) { // do somthing...

Core Data cannot resolve faults when object has "description" attribute?

EDIT: see below for a fix, but I don't understand why the fix works. :) Code: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"A" inManagedObjectContext:moc]; [fetchRequest setEntity:entity]; NSSortDescriptor *sor...

Do I need to update the table view manually after calling performFetch in a Core Data app?

I'm new to this Core Data business. I got a UITableViewController hooked up with a NSFetchedResultsController. In viewDidLoad, I fire a request to get necessary data from the server, then use [self.fetchedResultsController performFetch:&error] to update the table view. All works fine until that point. Now I want to move the data fetchi...

iPhone to Max with OSC: certain int messages get zero'd

I'm using the berkely OSC library. I'm using OSC_writeAddress() followed by OSC_writeIntArg() to send OSC buffers from iPhone to max/msp, one packet at a time. my range of values goes from 0 - 320. this works for integers 0 - 53, 74 - 127, 197 - 309 inclusive but all other values that i try to send arrive at max as 0.000000. I'm using t...