Need to have an NSTextField with a text limit of 4 characters maximum and show always in upper case but can't figure out a good way of achieving that. I've tried to do it through a binding with a validation method but the validation only gets called when the control loses first responder and that's no good.
Temporarly I made it work by ...
I'd like to use properties for my instance variables, but in many cases, I only want the class itself to have access to the setter. I was hoping I could do something like this:
Foo.h:
@interface Foo {
NSString *bar;
}
@property (readonly) NSString *bar;
@end
Foo.m:
#import "Foo.h"
@interface Foo ()
@property (copy) NSString *bar...
I'm making a simple tab bar iPhone application. It has two tabs, one with a UIWebView and the other with a few text fields to hold settings, and a button to save the settings.
What I want to do is reload the UIWebView when the user clicks save on the settings tab/view. I already have it saving the settings, I just need to figure out h...
Hello All,
When I try to edit texts in my iphone application (UITextfield), it auto-corrects my input. Could you let me know how can I disable this?
Thanks.
...
Ok, here goes. I've completed a Cocoa foundation-tool that calculates mean absolute deviation of random integers (Just as a learning project).
I've moved the calculation into a function called "findMeanAbsoluteDeviation()" It accepts a NSMutableArray of NSNumber objects to preform calculations. Anyways. So this works all fine and dandy...
I want to build my iphone application only using device ID without connecting the device to my apple PC.Can i do this?If yes then how can i do that.
please give me some instruction on it.
...
I've got a float value from an accelerometer which looks like this:
-3.04299553323
I'd like to get -3.04 for example. Is there an easy way for rounding that float value?
Edit:
http://stackoverflow.com/questions/752817/rounding-numbers-in-objective-c
...
Hi to all
I am developing one application. In that I have toolbar on keyboard. But I want that when I press keys, the key values should be displayed in toolbar textfield.
So if anyone knows kindly reply.
...
I'm dealing with an undocumented API that I'm trying to do a bit of reverse engineering on - don't worry this isn't malicious, just trying to fulfill a use case in a creative way.
I've got a pointer to a C structure. Is there a way for me to determine by examining the memory how many members this structure has? Their values?
I suspec...
I've been looking for some concrete scenarios for when NSOperation on the iPhone is an ideal tool to use in an application. To my understanding, this is a wrapper around writing your own threaded code. I haven't seen any Apple demo apps using it, and I'm wondering if I'm missing out on a great tool instead of using NSThread.
The ideal s...
Hi
Im working on an iPhone application and want to represent money ($) amounts. I can't use float because they introduce certain amount of rounding errors.
What can I use?
Im thinking of defining my own Money class and store dollars and pennies as NSInteger internally.
@interface Money : NSObject {
//$10.25 is stored as dollas=10 ...
I'm using the singleton pattern in several places in an application, and I'm getting memory leak errors from clang when analyzing the code.
static MyClass *_sharedMyClass;
+ (MyClass *)sharedMyClass {
@synchronized(self) {
if (_sharedMyClass == nil)
[[self alloc] init];
}
return _sharedMyClass;
}
// clang error: Object ...
Say I have a large number (integer or float) like 12345 and I want it to look like 12,345.
How would I accomplish that?
I'm trying to do this for an iPhone app, so something in Objective-C or C would be nice.
...
I have a feeling that this is stupid question, but I'll ask anyway...
I have a collection of NSDictionary objects whose key/value pairs correspond to a custom class I've created, call it MyClass. Is there an easy or "best practice" method for me to basically do something like MyClass * instance = [ map NSDictionary properties to MyClass...
I followed the Core Data tutorial at
http://macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app
The finished application displays data in an NSTableView. Is the ordering of the data persistent as well? And is there a way that you can allow drag and drop rearrangements to the order of the records? I am thinking ab...
I am having issues with adding a header to NSMutableURlRequest, the problem is that when I add the header below "Authorization" it does not show up. However if I replace my instance variable "auth" below with a static string exp (@"asdadsadsadga") it the "Authorization" header will show up. I am pretty lost at this point.
NSURL *url = [...
Hi,
I have a problem,
how can we retrieve the array data stored in plist file.
The plist file and source code is as shown below,
------------------------plist File-------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">...
I'm making an iPhone application that has my own custom text view that can display multi-formatted text and I need to interact with the keyboard somehow. Right now I am using a hidden UITextField and the delegate method textField:shouldChangeCharactersInRange:replacementString: to get the typed characters. However this feels kludgy and I...
I understand having one asterisk * is a pointer, what does having two ** mean?
I stumble upon this from the documentation:
- (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary **)errorInfo
...
I am developing one application. In that I want to detect through coding that "is iphone on silent mode or not?". I am developing it by using cocoa with objective-c.
If anyone knows it kindly reply.
...