Tag: cocoa touch

How can I refresh a NSFetchedResultsController?

I have a NSFetchedResultsController which displays data in a UITableView. I’m using the boiler plate code provided by Xcode when choosing to create a Core Data project. I added the following predicate to the NSFetchRequest the NSFetchedResultsController uses (before NSFetchedResultsController is initialized): NSPredicate *predicate = [NSPredicate predicateWithFormat:@”deleted == NO”]; [fetchRequest setPredicate:predicate]; Now in another location […]

Deleting breakpoints in Xcode

There are some breakpoints in my project that for some reason can not be turned off or deleted. How can I delete these? I heard that they can be deleted by deleting a file with the extension .dsk, but I can’t find that file. Where is it?

Display waiting screen when user selects UITable row

When the user selects a row in my table, I need to load a bunch of data with CoreData. This takes several seconds (at least when running on the simulator – haven’t tested on a device yet, but I imagine it will still be pretty long). I want to display a loading popover screen (I’m […]

NSOperationQueue becomes suspended at random?

I have an app that uses NSOperationQueue intensively. Sometimes I’ve noticed that some of the NSOperationQueues would “lock up” or enter a “isSuspended” state randomly even though my code never calls the setSuspended: method. It’s impossible to replicate and very hard to debug because whenever I hook the device up to Xcode to debug it, […]

UIButtons titleLabel clips Text after being rotated by CGAffineTransformMakeRotate()

I am developing a iOS-6 app. I have a UIViewController with a view that needs fixed orientation (portrait mode). But when the phone is rotated, one control on that view needs to be moved and rotated (so that it will always be in the upper left corner, and its text will be readable). I am […]

Download an asynchronous multiple images in UITableViewView?

How can i download an asynchronous multiple images in the UITableView using ASIHttpRequest or something useful? – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ………. // Creation UIImageView *avatar; UILabel *content; // Tag the IBOutlets avatar = (UIImageView*)[cell viewWithTag:14]; content = (UILabel*)[cell.contentView viewWithTag:4]; // Field avatar.image = image content.text = entryReviewtableView.content; }

Sort NSArray with NSDate object into NSDictionary by month

I am building a UITableView and would like to group by month so that I can have those strings as my section headers, e.g.: February 2013 – Item 1 – Item 2 January 2013 – Item 1 – Item 2 I have an NSArray which has custom objects that have a pubDate property that is […]

How to change the font size of a single index for UISegmentedControl?

The way to change the font size for a UISegmentedControl would be the following: UIFont *font = [UIFont systemFontOfSize:13.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [self.segment setTitleTextAttributes:attributes forState:UIControlStateNormal]; How can I change the font size for a single index in a UISegmentedControl? Or even better, if the text doesn’t fit in the segment (instead of […]

NSLineBreakByWordWrapping on First Line but NSLineBreakByTruncatingTail For Second Line?

Is this possible? I want to have a two line label. On the first line, I want it to wrap on words. But for the second line, if the text is too long, I want it to truncate by tail and add the ellipses “…” after. Any ideas on the simplest way to do this?

NSString internals – how does length works?

I’ve a question about NSString internals. I want to check a string length and basically I wanted to know if a NSString knows its length / count each time / count & cache the result. Should I store it’s length and compute or call the length method each time ? To test a string I […]