Hi all,
In an iphone application, I'm looking to convert a float to NSData for it to be sent over bluetooth and then converted back again when it's received. I have the bluetooth part working fine, but when I use this to convert to NSData:
NSData *data = [[NSData alloc]init];
float z = 9.8574; // Get the float value, 9.8574 is just an...
Hello guys!
How can I solve the problem I mentioned in the title?
So I have an UIImageView and in it there is an UIImage.
My UIImageView is in a View. When I set the origin of the imageview to (-120, -30) then I don't want to see the start of my imageview. Is this possible? Can this be done? How?
...
I am new to objective c and am trying to understand how/when autorelease is called. I understand the simple use case of:
- (void) foo {
Bar *b = [[[Bar alloc] init] autorelease];
[self doSomething:b];
}
What about this next case -- is this a bug, because the object will be immediately released upon leaving the scope of makeB...
Hello,
I would like to have several custom fields from a (server) database merged into Word Processing documents, beyond the normal "mail merge" fields. I'm not finding anything like an API out of the box that allows you to do this for custom fields. This seems like it would be pretty common in business software, but I assume that's one...
Sometimes when coding in Objective C for the iPhone I wonder if I should release an object in dealloc or is it sometimes better to release in viewWillDisappear if that view is a separate rarely used part of your app.
Thanks.
...
Has anyone had issues with a size limit on a returned JSON Object using the JSON Parser that is available for the iPhone?
Here is a link to the JSON framework I am using:
http://code.google.com/p/json-framework/downloads/list (I am using the latest version)
If I reduce the size of the returned JSON my app will run just fine. If the ob...
I'm using AVAudioRecorder in the AVFoundation framework.
I'm wondering how I can check for a microphone device being plugged in (on the iPod Touch)?
...
In PHP and in JavaScript you can dynamically use a variable by using another variable as part of its name. I do not want to use an array as part of the solution. Can this be achieved in Objective C? I'd like to do something like this:
for (int i=1; i<6; i++) {
if([appRecord.answer(i) length] != 0){
self.textView.answ...
Hello,
I am porting a project to the iPhone system and I am facing the following problem:
I have an header containing c++ templates
If I rename it to .mm, it does not compile (because it should be an header) and if I keep it as .h, it is interpreted as an objective C header
Do you have a workaround to fix this issue?
Thanks in advance...
Good afternoon. I am a user experience designer, proficient in XHTML and CSS. I have dabbled with some PHP and JavaScript but by no means am I comfortable with them.
My main goal is to develop OS X and iPhone software. I have been given advice on those topics, but in I am struggling with Object Oriented programming.
Books that I have ...
Right now when one of my asserts is triggered in Xcode, I get the assert message, and a dump of the stack, which is full of numbers that are not very meaningful to me.
In order to get a trace of the call stack, it requires me to debug the application, and run it up to the point where the assert occurred, and hope that it asserts again....
I have custom UITableViewCells (created in interface builder) which are used for a static UITableView which for the sake of argument I will call the AddUserTableViewController (i.e. I do not use autoreleased cells as I only have 5 rows).
In the top cell (used for the user name) I have embedded a UIButton which I use to open an UIActionS...
In objective-c, I understand that you need to release anything you init/retain/copy. Do I need to do that before a return statement? I'm wanting to understand calling release explicitly and not use autorelease.
-(void) someMethod
{
AnotherClass* ac = [[AnotherClass alloc] init];
if([ac somethingHappens]){
// Do I need to relea...
I'm working with an NSTextView and one of the requirements I have is that a tab character, '\t', shall have the same width as four spaces.
So the text-content would look like this:
AAAA
AAAA - 1 tab
AAAA - 4 spaces
And this is how I accomplish this:
// done when NSTextView first loaded and when
// delegate's textDidBeginEdit...
Can I tag a UIColor that is constantly changing values for easy access from methods?
...
Hi,
I want to calculate the numbers of hours passed on a day from an NSDate object (in UT).
Basically, the example should look something like "17 hours and 31 minutes".
Thanks!
...
Ok here is an interesting one... I am receiving the
warning: Characters may not respond to 'addHeroType:atX:atY:fromMobTable'
although I have the functions defined properly as far as I can see so how about another pair of eyes?
Here is the definition in Characters.h
-(void) addHeroType:(int)newMobType atX:(int)x atY:(int)y fromMobTab...
Still having great difficulty with this problem. Any suggestions?
I cannot find a simple tutorial online that explains the basics of NSPanel windowing as different from NSWindow.
I have an HUD window that I'd like to show as a notification & input box, but I cannot for the life of me figure out how. My attempts are below.
I know thi...
I have this in java:
public interface SomeInterface {
public void doSomething();
}
public class ParentClass {
}
public class ChildClass extends ParentClass implements SomeInterface {
public void doSomething() { }
}
Is this possible on objective c? How to do it on objective-c?
...
I'm wondering how bad is the following code for experienced objective-C programmers.
self.request = [[ASIHTTPRequest alloc] initWithURL:url];
[self.request release];
It is definitely less verbose this
ASIHTTPRequest *tmp = [[[ASIHTTPRequest alloc] initWithURL:url];
self.request = tmp;
[tmp release];
But I'm not sure if it is meanin...