|
Thanks for the feedback. I'll stick with the VM that I set up for .NET stuff.
|
# ? Aug 22, 2012 03:25 |
|
|
# ? May 17, 2024 15:46 |
|
The one thing I'd recommend is to install Notepad++ in the VM if you haven't, it has a very nice syntax scheme for assembly (and MASM's editor is shockingly old/awful.)
|
# ? Aug 22, 2012 03:42 |
|
How can I tell if a string within a JSON object is empty? This seems like it'd be so damned simple but absolutely nothing is working so far. For example a JSON object like:code:
code:
code:
code:
So what the hell is going on here? It's a string object but apparently not an empty string nor nil nor is it NULL. How do I detect this thing? e: argh i had to do code:
Yodzilla fucked around with this message at 15:36 on Aug 22, 2012 |
# ? Aug 22, 2012 15:30 |
|
== is pointer comparison (ie is this object *literally* the same as another object). There are a couple of ways to check empty strings:Objective-C code:
|
# ? Aug 22, 2012 15:40 |
|
I thought I had tried isEqualToString as well since I've used it everywhere else in the project. Apparently not.
|
# ? Aug 22, 2012 15:43 |
|
Yodzilla posted:i still don't know why the other methods didn't work though @"" creates an NSString, and like Carthag said, == compares pointer values. The empty NSString literal and the JSON NSString are different objects. Fun fact, you can send messages to literals; e.g., [@"blah" length]
|
# ? Aug 22, 2012 17:52 |
|
Comparisons(etc) are the one area objective C really does suffer a bit. It would be NICE to be able to go if([blah string] == @"ra") { stuff; } but poo poo just doesnt work like that.
|
# ? Aug 22, 2012 20:27 |
|
I look forward to @==, @>, @>=, @<, @<=, @~, @>>, @<<, @|, @&, @||, @&& But yeah you're right, pointer equality's pretty unhelpful.
|
# ? Aug 22, 2012 20:32 |
|
Toady posted:@"" creates an NSString, and like Carthag said, == compares pointer values. The empty NSString literal and the JSON NSString are different objects. You're right but your explanation is wrong. @"" does not create an object (not at runtime, anyway). It points to a NSConstantString. I believe its value is stored in the program data and, to my knowledge, retain and release re no-ops on it. I don't have access to a working XCode at the moment but do some tests and see if @"" == @"" and @"foo" == @"foo".
|
# ? Aug 22, 2012 23:15 |
|
They probably will, since the compiler eliminates duplicate string literals.
|
# ? Aug 22, 2012 23:49 |
|
String literals point to the same object even if defined in multiple places.Objective-C code:
pre://output: [ carthag@mbp.local:~ ]$ clang -framework Foundation literals.m && ./a.out 2012-08-23 00:57:26.806 a.out[37523:707] == : 1 2012-08-23 00:57:26.807 a.out[37523:707] == foo: 0 2012-08-23 00:57:26.807 a.out[37523:707] foo == foo: 1 2012-08-23 00:57:26.808 a.out[37523:707] == : 0
|
# ? Aug 22, 2012 23:58 |
|
pokeyman posted:I look forward to @==, @>, @>=, @<, @<=, @~, @>>, @<<, @|, @&, @||, @&& Apple's eventually gonna have to stop overloading everything onto @ and introduce a new memory-managed language. There is no way we are still writing Objective-C code in 10 years where we still get seg faults because we stomped on memory. In my dream world they buy Xamarin and introduce Objective-C#. I'll take nsArray.Where().Select() for 500 Alex.
|
# ? Aug 23, 2012 00:57 |
|
Today I also learned that initWithNibName is case insensitive in the iOS Simulator but case sensitive on actual devices. It was a stupid mistake but one that took me a while to catch on to because, well, I thought it was a memory problem or something wrong with my pushing a view to the stack. Turns out I just didn't capitalize a letter.
|
# ? Aug 23, 2012 01:23 |
|
The filesystem on iOS is case sensitive. The filesystem on OS X is not (though it does preserve case). Which is why, on the simulator, initWithNibName: works regardless of case.
|
# ? Aug 23, 2012 01:40 |
|
I'm interested in doing something similar to a train ticker flip effect. Should I be using Core Animation for this? If so, what is the best resource to start learning CA?
|
# ? Aug 23, 2012 04:28 |
|
Doc Block posted:The filesystem on OS X is not (though it does preserve case). I then realized the only reason to do that is if you like your software not working - a lot, like Adobe Creative Suite, won't even install on a case sensitive volume.
|
# ? Aug 23, 2012 05:09 |
|
I suggest keeping all your data on a case-sensitive partition but leaving a large case-insensitive root partition to install things on. We're basically forced to do that here for OS-testing purposes, but it works out pretty well regardless. It also means you can extra-special encrypt your data partition if you're into that kind of thing.
|
# ? Aug 23, 2012 05:55 |
|
Ender.uNF posted:In my dream world they buy Xamarin and introduce Objective-C#. I'll take nsArray.Where().Select() for 500 Alex. *pukes furiously all over your vision* I'll pass on dot net shoehorned onto mobiles thanks
|
# ? Aug 23, 2012 10:27 |
|
kitten smoothie posted:You can format an OS X volume to be case-sensitive, and I tried it once after burning a few hours on a case sensitive asset issue with iOS and thinking I was due for a flatten/reinstall anyway. Oh hell that sounds like a nightmare. I'm guessing you re-wiped and went back to case-insensitive?
|
# ? Aug 23, 2012 12:51 |
|
I have a screen with a bunch of UITextFields. They all have incremental tags on them. When I focus on the first text field (r any other one for that matter) and hit the TAB key on my keyboard in the simulator, every single text field has textFieldShouldBeginEditing: called on it, with no other delegate notifications called at all, even on the one that was first responder. Has anyone else seen this? Is it a simulator bug (I do not have a bluetooth keyboard to test on device)? It's causing all sorts of awful stuff to happen since a couple text inputs display popovers to let the user select a value. It's very likely users of this App will have keyboards, so it's something I need to address.
|
# ? Aug 23, 2012 16:09 |
|
If I'd like to get into developing apps, is the base Mac Mini a good choice if that is all I am using it for? Just curious since there is no room for upgrading the model itself.
|
# ? Aug 23, 2012 16:42 |
|
Doctor w-rw-rw- posted:You're right but your explanation is wrong. @"" does not create an object (not at runtime, anyway). It points to a NSConstantString. I believe its value is stored in the program data and, to my knowledge, retain and release re no-ops on it. Though the data is stored in the executable, it is an NSString object at runtime, which is all I meant.
|
# ? Aug 23, 2012 17:48 |
|
Carthag posted:Man pages are your friend: Thanks, this worked perfectly. I tried making one that is supposed to check every file, but I don't see the changes on the files. find . -type f -exec sed -i 's/onclick="js(setPanoName(/onloaded="js(setPanoName(/g' {} \; Edit: I changed my command to: sed -i '' 's/onclick="js(setPanoName(/onloaded="js(setPanoName(/g' *.xml; And it works! LP0 ON FIRE fucked around with this message at 18:10 on Aug 23, 2012 |
# ? Aug 23, 2012 17:57 |
|
Yodzilla posted:Oh hell that sounds like a nightmare. I'm guessing you re-wiped and went back to case-insensitive?
|
# ? Aug 23, 2012 18:31 |
|
Toady posted:Though the data is stored in the executable, it is an NSString object at runtime, which is all I meant. I know, I was just . The class itself actually doesn't change location, either, so the object itself is there before runtime! NSString *asdf = @"asdf"; NSLog(@"address: %d", asdf); // Ignore the warning
|
# ? Aug 23, 2012 18:43 |
|
%p
|
# ? Aug 23, 2012 20:04 |
|
cereal eater posted:If I'd like to get into developing apps, is the base Mac Mini a good choice if that is all I am using it for? Just curious since there is no room for upgrading the model itself. Yes, the Mac Mini is a great little computer. I bought one to use for iOS dev and wound up making it my main machine (until I bought an iMac).
|
# ? Aug 23, 2012 20:22 |
|
pokeyman posted:I look forward to @==, @>, @>=, @<, @<=, @~, @>>, @<<, @|, @&, @||, @&& Wait, is that an actual thing or are you just anticipating what will probably end up coming? I don't remember @==, etc coming up in the "Modern Objective-C" sessions.
|
# ? Aug 23, 2012 20:57 |
|
I've been developing at work on a 2010 model Mac Mini for iOS, and it's been fine. The only thing that gets a little slow is when I'm using some kind of tool like leaks. When I upgraded from 2 gigs of ram to 8, it was like I had a whole new machine, so I'd definitely recommend that.
|
# ? Aug 23, 2012 21:13 |
|
ultramiraculous posted:Wait, is that an actual thing or are you just anticipating what will probably end up coming? I don't remember @==, etc coming up in the "Modern Objective-C" sessions. Just joking.
|
# ? Aug 23, 2012 21:17 |
|
Doctor w-rw-rw- posted:I know, I was just . Since we're , Apple folks have hinted at someday allowing collection literal syntax to be used to initialize globals, which C requires to be compile-time constants, so maybe we'll see NSConstantArrays someday.
|
# ? Aug 23, 2012 21:31 |
|
Anyone have any experience with CocoaAsyncSocket? I'm using the GCDAsyncSocket and am getting notifications into my object after it has been deallocated. I'm running with ARC if that matters. I am closing down my code before it gets dealloced to stop any subsequent notificationscode:
code:
code:
Any ideas what might be happening or workarounds that might be worth a shot?
|
# ? Aug 24, 2012 00:07 |
|
Any idea if it is possible to codesign an Applescript Applet app to pass Gatekeeper? I'm trying to get the printer setup utility for the residential network I work for to work with minimal hassle in 10.8. If you have a Developer ID, my team would be very grateful if you can see if you can sign this App and check if Gatekeeper is cool with that. We're not a Mac shop so dropping $100 for what might be useless would not be ideal. We don't have other things to sign other than this: https://www.dropbox.com/s/p60rzk0umu7ti9a/mac_print.zip If it works, we'll be getting our ID and signing that ASAP before September move-in. Otherwise, we will be providing temporary bypass instructions. Thanks in advance. crazysim fucked around with this message at 00:53 on Aug 24, 2012 |
# ? Aug 24, 2012 00:50 |
|
I'm coming from a C/C++/Python background and Objective C's syntax (punctuation? Not sure what I want to say here -- all of the symbols and the way it uses it) are really screwing me up. XCode's autosuggest/correct is also constantly interfering and writing crap I don't need/want and is screwing my code up when I try to type things and XCode makes it something else that I don't want. Is there anything else I could be doing/not doing or should I just soldier on? I'm using BNR's iOS Programming v3, by the way. Edit: I just hit page 77 on Dot Syntax and my headache magically went away. tarepanda fucked around with this message at 07:00 on Aug 24, 2012 |
# ? Aug 24, 2012 06:37 |
|
Carthag posted:String literals point to the same object even if defined in multiple places. Note that this will no longer be true in the future. From http://clang.llvm.org/docs/ObjectiveCLiterals.html: quote:Objects created using the literal or boxed expression syntax are not guaranteed to be uniqued by the runtime, but nor are they guaranteed to be newly-allocated. As such, the result of performing direct comparisons against the location of an object literal (using ==, !=, <, <=, >, or >=) is not well-defined. This is usually a simple mistake in code that intended to call the isEqual: method (or the compare: method).
|
# ? Aug 24, 2012 07:58 |
|
tarepanda posted:I'm coming from a C/C++/Python background and Objective C's syntax (punctuation? Not sure what I want to say here -- all of the symbols and the way it uses it) are really screwing me up. XCode's autosuggest/correct is also constantly interfering and writing crap I don't need/want and is screwing my code up when I try to type things and XCode makes it something else that I don't want. You can change Xcode's preferences so that it doesn't autocomplete as you type.
|
# ? Aug 24, 2012 13:23 |
|
Doc Block posted:You can change Xcode's preferences so that it doesn't autocomplete as you type.
|
# ? Aug 24, 2012 15:30 |
|
Whoever was lusting after C#'s class and property attributes (Ender.uNF?), check out extobjc.
|
# ? Aug 24, 2012 18:44 |
|
Where do you guys get the memo about the new additions? I knew NSNumber *n = @123 was going to be a thing but I didn't know it was in there already.
|
# ? Aug 24, 2012 18:48 |
|
|
# ? May 17, 2024 15:46 |
|
If you have a dev account you get access to seeds of pre-release versions. For non-developers, there might be some murmurs on lists like objc-language. The literals were formally introduced at WWDC '12 - check out the videos ("what's new in Objective-C")
|
# ? Aug 24, 2012 18:51 |