I want the user to be able to make some preferences like colors, prefered images, etc.
When I use NSUserDefaults for this, on first start of the app there will be no preferences, right? So, every time I want to get a preference like
NSInteger avatarID = (NSInteger)[[NSUserDefaults standardUserDefaults] objectForKey:@"avatar"];
I have t...
Is there a way to preset UISlider values to something such as:
100, 121, 10000, 40505, 100000, 460322, 1000024, 5005230, etc...
The numbers don't have a pattern. As the user moves the slider, I'd like to display the above numbers as corresponding to where the user is on the slider. The slider displays numbers in specific increments a...
I've added NSUserDefault data retrieval to my app, which is pretty nice. But for testing I would like to reset all the data I added to the defaults database, so that everything is in the state when the user launches the app the first time.
I tried to call:
[NSUserDefaults resetStandardUserDefaults];
but that doesn't do anything. The d...
I've implemented an UIScrollView which contains a grid of UIImageView objects. For both, the superview and it's subviews, userInteractionEnabled is YES. As the user scrolls and his/her finger touches an UIImageView, it imediately recognizes a tap on that, which is not what I want ;)
Inside of that UIImageView objects I have this method:...
I have an Tab Bar controller and a nice tab bar on the bottom of my app. There are three buttons. When I tap one, then the view controller from that tab bar is "invoked" and the new view appears immediately. That's like banging a door very hard, so that everyone in the neighbourhood can hear it. I would like to have a softer transition, ...
I have about 50 CGPoint objects that describe something like a "path", and I want to add them to an NSArray. It's going to be a method that will just return the corresponding CGPoint for an given index. I don't want to create 50 variables like p1 = ...; p2 = ..., and so on. Is there an easy way that would let me to define those points "i...
Probably I could create a class that holds an CGPoint as instance variable, like a wrapper. Does that make sense? I feel uncomfortable with that, though. I hope there is an better solution.
How about any self-created scalar type? Like MyCoolScalarType?
...
It seems like if this method will be called any time the user touches my view:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
if ([touch view] == self && [touch tapCount] >= 1) {
// do something...
}
}
I've implemented this in an UIScrollView. The documentation...
I have a custom UITableViewCell subclass. I have set the contentView of my cell subclass to
a custom UIView class in which i am overriding -drawRect: and doing all of the drawing there.
Also, I am setting cell.contentView.opaque = NO in order to achieve transparency in certain areas of the cell (unfortunately, a backgroud image behind...
My app is doing some pretty but heavy weight core animations during scrolling. Sometimes it crashes due to bad performance. So I need some way to find out if there is enough capability to make the animations, and if not, I just leave them away. Best way would be if I could ask the system how busy it is.
UPDATE: I mean especially Core An...
How do i change the location of the text AND show the FULL string in UITableView?
Here is a screen shot of what I have, once you look at it you will know what I mean. Thanks
...
I want to scroll text starting on the right and make it smoothly move to the left and off the screen. Does anyone have an example of something they tried that worked? Thank You.
...
Hello,
I'm currently populating model objects into an NSSet (perhaps I should be using NSCountedSet). The models should be unique. What I do is pull them in from a web service, and then instantiate them on the client-side and add them to a set.
My problem is the following: There are times when I'll only pull one model and add it to the...
I'm loading a nib as:
ContentViewController *theController = [[ContentViewController alloc] initWithNibName:@"ContentView" bundle:nil];
which has a label on it. The view controller has an IBOutlet of UILabel with a @property of retain and synthesized variable. When I load the nib as above from another class and reference the label's...
Hi all,
I currently have one UITableViewController that contains many cells with simple data in it. When the UITableViewController instantiates a UITableViewCell, it begins running a background thread for each individual cell to get its state from the server. The UITableViewCell is subclassed and already has a UIImageView property that ...
I have a very straight forward class with mostly NSString type properties. In it, I wrote a trivial implementation of the description method. I found that whenever I try to include "self" in the description, it crashes my iPhone app. An example is something such as the following:
- (NSString *)description
{
NSString *result;
re...
I have an app that's half way done. The performance is not really good, and I wonder where the bottlenecks are. Although I can go ahead and start commenting out suspected lines of code, I wonder if there are any tools that would tell me which method cool took how long and what happened next. The stack trace isn't really that helpful.
I ...
This may seem stupid, but I still couldn't figure out how to mark a attribute as a primary key in the xcdatamodel file.
My persistent storage is sqlite file.
Can anyone help me?
In that case, how can I "validate" a ID to be unique?
Should I write a validation method or something?
...
I want to write some functions for that, but before I do: Are there any to convert between time units?
...
On an iPhone, how do you figure out the width of a table view cell's content view when it is showing a certain accessory view (disclosure indicator, etc)?
I need this in order to calculate the correct cell height for cells that contain wrapping, variable-length text. But when the table view delegate is asked for a cell height, it doesn...