I'm rotating a view that's placed in Interface Builder using CGAffineTransformMakeRotation, but even though I have the anchor point set to the top left in Interface Builder the rotation still happens around the center of the view. As a crappy work around I am setting the anchor point upon startup and then repositioning the view, i.e.:
[...
This is a rather simple example and probably wouldn't make much of a difference anyway, but say I have this drawing code in a view to draw a gradient:
@interface SomeView : UIView
@end
@implementation SomeView
- (void)drawRect:(CGRect)rect
{
const CGContextRef ctx = UIGraphicsGetCurrentContext();
// Set fill color to white
...
For my current app I'm using the NSKeyedArchiver approach to persist my objects to the iPhone between launches. I'm wondering if it makes sense to tag this file when it's created with a version number so that in the future when the app revs we'll know what kind of data we're dealing with should migration be necessary. Is this recommended...
I want to play prerecorded audio for users in an iPhone application. Is the best way to play this audio to use openAL? Is there any other way that might be beneficial for what I want to accomplish?
Thanks!
Joe
...
What would be your approach to creating a home page like the new facebook 3.0 app has to offer? There's a grid of 3x3 UIButtons it appears if you look here:
If you wanted to replicate a similar user interface, would you programmatically have 9 individual buttons that you place on the screen through some kind of loop? If so what would ...
I have an IPhone app that uses webservices to get data from a server. I'm putting each call to the webservice in a NSOperation subclass so that it can be threaded. My question is, what is the recommended way to pass back information from a completed NSOperation subclass. I'm currently sending a NSNotification at the end of my main met...
I'm creating an application where I want to let the user move (not pan) an UIImageView around by dragging it on the screen. Additionally, I want the user to be able to zoom the UIImageView in and out.
As such I've been using a custom UIScrollView that forwards single touches to the 'contentView':
@implementation JM_UIScrollView
- (BO...
Hi,
I am trying to convert an image into grayscale in the following way:
#define bytesPerPixel 4
#define bitsPerComponent 8
-(unsigned char*) getBytesForImage: (UIImage*)pImage
{
CGImageRef image = [pImage CGImage];
NSUInteger width = CGImageGetWidth(image);
NSUInteger height = CGImageGetHeight(image);
NSUInteger byte...
I am using a UINavigationController (side note: inside a UITabBar) which by default gives you a UINavigationBar on the top. If I hide the bar through IB, the bar is gone not only for the root UIViewController but also for all the controllers I push onto the stack. Leaving me no (automatic) way to pop back.
So how can hide the UINavigtio...
I have an app that makes SOAP calls. To keep the UI from blocking, we are putting each SOAP call into a subclass of NSOperation. This works well, but we have a ton of different types of SOAP calls. So if we use 3 WSDLs each with 10 Ports or Operations, then we 30 different calls in SOAP and if we put each of those in a thread using NS...
Is it possible to create an own obj-C Cocoa Touch framework which can be used by other developers? And furthermore can you protect this framework?
...
I have a simple UIButton and want to do something when the user touches it, but then moves the finger outside the button and untouches the screen. So that seems like I need to listen for the UIControlEventTouchUpOutside event.
In my view controller, I did this:
UIButton *bt = [[UIButton alloc] initWithFrame:rect];
[bt setBackgroundCol...
2009-08-19 11:00:06.482 Pickers[26090:20b] *** Assertion failure in -[UIDatePickerView _updateBitsForDate:andReload:animateIfNeeded:], /SourceCache/UIKit/UIKit-963.10/UIDatePicker.m:908
2009-08-19 11:00:06.483 Pickers[26090:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter n...
I'm using the standard People Picker Navigation Controller to let users associate one of their contacts with one of my objects. It presents itself as a long list of ALL contacts. The back button (top left) says "Groups" but when clicked on it shows an empty screen...even when there are many Groups in the user's address book. I've read th...
Apple says:
removeFromSuperview Unlinks the
receiver from its superview and its
window, and removes it from the
responder chain.
(void)removeFromSuperview
Never invoke this method while
displaying.
So before I call that, I should call setHidden:YES? Would that be enough?
...
In Xcode, you can view all the header files of the cocoa-touch framework, but I'm just curious to see what some of the implementations look like. Is there a way to see them? They must be on the system somewhere, right? The header doesn't do anything without the implementation.
...
I've added several localization files (for several languages) to a xib. Do I also need to do the same for all other xibs?
Should I just make all of my labels IBOutlets, use NSLocalizedString in the related .m files that will assign values to the labels? Then I wouldn't have to create all of these localization files. At least for the ...
I have setup Core Data for an iPhone app without an instance of NSFetchedResultsController.
To do this, I created a created a model class to encapsulate all core data requests and constructing of NSFetchRequests/NSPredicates.
This kept all Core Data specific code out of my UITableViewController.
Now I want to add NSFetchedResultsContr...
The iPhone keyboard overlaps the tab bar by default, but it also behaves like a subview of the view that is inside the tab bar; for example, if it is open inside a UINavigationController-governed view, and you navigate Back, the keyboard slides away along with the view.
How do I get a UIPickerView to behave like this? It's layered behin...
Is it possible to run some javascript code (having perhaps an NSString as input) without using a UIWebView? I would like to run this code in a separate thread so UIWebView is not possible and I don't really want to render anything, just get back the results.
...