uikit

How to NSLog pixel RGB from a UIImage?

I just want to: 1) Copy the pixel data. 2) Iterate and Modify each pixel (just show me how to NSLog the ARGB values as 255) 3) Create a UIImage from the new pixel data I can figure out the the gory details if someone can just tell me how to NSLog the RGBA values of a pixel as 255. How do I modify the following code to do this? Be Speci...

What kind of data is in an "enum" type constant? How to add it to an NSArray?

What kind of information is stored behind such an enum type thing? Example: typedef enum { UIViewAnimationCurveEaseInOut, UIViewAnimationCurveEaseIn, UIViewAnimationCurveEaseOut, UIViewAnimationCurveLinear } UIViewAnimationCurve; I am not sure if I can safely add such an enum constant to an array. Any idea? ...

How to explode this string into substrings?

Consider this example: zh_Hant_HK format = yy'年'M'月'd'日' ah:mm Not sure if you can see it, but I see a lot of chinese symbols in there. I've got that string out from a date formatter, which corresponds to a Asian locale. Do I have to consider anything special when trying to get "character" by "character", i.e. looking at every char se...

unichar and NSString - how interchangeable are these?

There is an NSString method -characterAtIndex: which returns an unichar. (unichar)characterAtIndex:(NSUInteger)index I wonder if this unichar, which obviously is not an NSString, can be converted into an NSString or feeded to an NSString for comparing purposes? And: Does an NSString internally just consist of an array of uni...

Performant way to build long strings in a loop?

I have a loop that builds up a pretty large string. With every iteration a little string snippet is added to that string, and that string becomes bigger and bigger. Is there something better than using an NSMutableString and appending another string to that? ...

How to take an NSString out of an NSMutableString?

That's somewhat confusing. NSMutableString inherits from NSString, but does that also mean that I can pass an NSMutableString anywhere safely where actually an NSString is wanted? And can I assign an NSString to an NSMutableString? How would I get an NSString out of an NSMutableString to avoid problems, if any? ...

Improving Finger Painting Performance...

Simple Painting: Fingering the iPhone screen paints temporary graphics to a UIView. These temporary graphics are erased after a touch ends, and are then stored into an underlying UIView. The process is simple: 1) Touch Starts & Moves >> 2) Paint Temporary Graphics on top UIView>> 3) Touch Ends >> 4) Pass Temporary Graphics To under...

How to launch iPhone Camera on viewDidLoad?

I can't seem to launch the camera when loading my view. I end up making the user have to find and press a button on the screen just to load the camera (redundant). How can I do this? Code follows: // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { self.imgPicker = [[U...

How to re-load UIView after memory unload?

My main view controller (representing the Main Menu in my app) has a simple UIView with a few sub views. I am using a modal-type design pattern and switch to multiple other view controllers before finally returning to the main menu. The problem is, in my other view controllers (not the main menu one), I often load data-heavy images and t...

How to disable iphone UI?

I start doing some things on multiple threads and I want to disable the UI while the new thread is working so that the user doesn't accidentally launch a duplicate. Is there a good way to do this? ...

Common multithreading mistakes beginners make on iPhone...

I just introduced multithreading into my app JUST to get a silly UIActivityIndicatorView to work. Well, the activity indicator works, alright -- but now my app crashes sometimes, and sometimes it doesn't -- under otherwise controlled conditions... I need to figure this out but don't know where to start looking... So, what are some commo...

IPhone - Animate from Loading Screen to Main Application View

I have an IPhone application that I want to attempt login and do some initial setup before showing the UI. I currently have my Default.png set to an image and I have a view that has that same image. When my app loads the Default.png loads and then my loading screen loads. The loading screen is the view for my root view controller in t...

IPhone - UIView addSubview Gap at top

I have a view that is loaded in the MainWindow.xib. It is just a view with a uiimageview in it that shows a image on the entire screen ( 320 X 480 ). When the app loads I display this view and then I do a [self.view addSubview:tabbarController.view]; Tab Bar Controller is just a UITabBarController with 2 View Controllers added to it...

UINavigationController inside a UITabBarController inside a UINavigationController

My problem is that I want to have a tab bar view with its children view controllers shown first. In the children view controllers, depending on what controls are clicked, I either want to A) drill down within the tab bar view (swiping away the child view controller) or B) drill down over the tab bar view (swiping away the tab bar view co...

UIImagePickerController-related code crash app after 25 or so camera use

I read a few memory-leaking issues with UIImagePickerController, so I changed my code to using member variable and was able to take more than a few pictures with the camera. However, I find the photo-taking to take longer and longer time, and eventually it crashed at around 25 photos. There are two things I do after the photo in the di...

IPhone - Move detailTextLabel within UITableViewCell

I am building a UITableViewCell. I am using the style UITableViewCellStyleSubtitle for my table view cell. In the textLabel of the cell I have data that can require a wrap. So to accomodate, I want to move down the detailTextLabel so that the wrapped text isn't covered by the text in the detailTextLabel. I am attempting the following...

Showing UISearchBar "X" within text field vs. adjacent Cancel button

I know I can set showsCancelButton to NO for a UISearchBar ... until you tap the search bar text field, and then the cancel button appears anyway! (At least it does for me.) Is there a way to show the "X" in a circle within the UISearchBar text field vs. having that separate Cancel button show up adjacent to it? Note that this button on...

How to safely create an NSInteger from an CGFloat?

I've got an CGFloat but need it as an NSInteger. The float value is like 2.0f, so I don't mind about fractional parts and loosing precision. What's a legal way to convert it into NSInteger without trouble (except the loss of precision, of course)? NSInteger niceInt = niceCGFloat; seems too simple, smells buggy. Maybe you can explain? ...

What resolution should my iPhone app ICON be?

What image resolution can/should be used as the icon.png file for an iphone app? I know the size is 57 x 57 but what about the resolution? Links to specific documentation relating to iphone app icon design would also be helpful. ...

What does that mean? "mi_cmd_stack_list_frames: Not enough frames in stack."

Debugger is telling me this, when I run my app on device: Program received signal: “EXC_BAD_ACCESS”. mi_cmd_stack_list_frames: Not enough frames in stack. mi_cmd_stack_list_frames: Not enough frames in stack. I don't get information about where in code that happens. That's all I get. Any idea what that could mean? The app crashes af...