|
With lots of trial and error, I ended up making my own method to stroke text with some amazing results. I expected this to run slowly because it sometimes renders text with a stroke as a UIImage many times per second.code:
code:
|
# ? Feb 9, 2012 23:32 |
|
|
# ? May 16, 2024 18:46 |
|
You don't need to completely destroy & recreate the UIImageView every frame. Just docode:
code:
Doc Block fucked around with this message at 01:13 on Feb 10, 2012 |
# ? Feb 10, 2012 01:02 |
|
Thanks Doc Block. I didn't realize I could just keep using that same UIImageView. I'll try that out tomorrow. Also it does only create a new image only if tetraCount changes, and not every frame.
|
# ? Feb 10, 2012 07:00 |
|
Got a contractor who put their domain into the package name. App is pretty simple -- can I just change the package name in xcode and be done with it? Or are there other places I need to clean this up.
|
# ? Feb 10, 2012 16:52 |
|
So, Apple have told us that we need to now include retina display screen shots for our iphone and ipod touch apps. Now, avoiding the discussion of "Are you retarded, test your crap on a retina capable device you dweeb!" because my apps are making enough money without being developed for retina displays, I would like to ask if anyone knows of a way to get the simulator to provide retina resolution screen shots. Anyone know? It might well be built in there. I have used simulator screen shots for all of my apps in the past, and all has been fine, just not certain whether the simulator has retina resolution (I imagine not).
|
# ? Feb 12, 2012 00:21 |
|
In the simulator's menu, go Hardware->Device->iPhone (Retina) Also, for non-game apps you don't have to do anything for Retina support beyond providing @2x images. Your users will thank you if you do. I would hate using an app that, 1.5 years after the iPhone 4 came out, still doesn't use Retina images.
|
# ? Feb 12, 2012 00:57 |
|
All right, fine, I'll update my four year old game for retina
|
# ? Feb 12, 2012 02:25 |
|
Graphics question: I am not using VBOs in my OpenGL pipeline. Will re-writing my graphics to use VBOs/VBAs improve the performance on the iPad 1? If this is to prevent sending geometric data to the graphics memory every frame, does this actually matter since the iPad 1 uses system memory? Here's an Instruments run with the OpenGL Analyzer:
|
# ? Feb 15, 2012 01:34 |
|
If it's a 3D game, you'll probably see a performance gain by switching to indexed arrays. Basically, you have an array of your vertexes, but not (necessarily) in the order to draw them. Then you have an array of 8- or 16-bit ints that are just indexes into your vertex array, and those are in draw order. The idea is to cut down on the amount of data that needs to be sent to the GPU by not having to send over shared vertexes multiple times (once for each poly). Not so sure about VBOs, though. Like you said, the iPad GPU uses shared memory. Maybe do a test app and see. edit: in any case, it looks like you've got some optimizing to do. Doc Block fucked around with this message at 02:03 on Feb 15, 2012 |
# ? Feb 15, 2012 01:58 |
|
Question for any iOS devs making (or planning to make) money through in-app purchases: what services/libraries/whatever do you use to record what people are actually doing in your app? (not counting Flurry, which really just tracks high level stuff)
|
# ? Feb 15, 2012 10:30 |
|
How are you guys unregistering observers and bindings in ARC projects? (since dealloc can't be counted on)
|
# ? Feb 15, 2012 16:24 |
|
Sorry, why can't -dealloc be counted on?
|
# ? Feb 15, 2012 19:17 |
|
I have many objects observing other objects, objects can be deallocated while there are still listeners attached. The solution proposed here is to have them also listen to an 'alive' var and remove themselves when that value changes. http://stackoverflow.com/questions/990069/when-should-i-remove-observers-error-about-deallocating-objects-before-removing I'm just researching all options. When dealloc is called, we can't trust that the object isn't being observed. Kallikrates fucked around with this message at 20:12 on Feb 15, 2012 |
# ? Feb 15, 2012 19:45 |
|
That issue has nothing to do with whether or not you are using ARC. Edit: Also, adding an observer does not increase the retain count. But if you're observing something, you should probably have a strong reference to it anyway. Zhentar fucked around with this message at 20:08 on Feb 15, 2012 |
# ? Feb 15, 2012 20:02 |
|
We didn't start noticing it till after we switched the project over. But the affected bindings and observers are ones setup in IB.
|
# ? Feb 15, 2012 20:06 |
|
Doc Block posted:If it's a 3D game ... I just spent some time trying out some indexed drawing (got it to work... yay), when I realized that I'm drawing 2D only, so there aren't any duplicated vertices. I don't think I'll get a performance boost if I switch over.
|
# ? Feb 15, 2012 21:02 |
|
Ended up being a strong, weak ref issue.
|
# ? Feb 15, 2012 21:33 |
|
This has me mystified:code:
code:
|
# ? Feb 16, 2012 11:31 |
|
As far as I can tell, NSDate is unaware of timezones, that all takes place in NSDateFormatter, so that might be it. Maybe this helps: http://stackoverflow.com/questions/2534757/nsdate-datefromstring-how-to-parse-around-utc-gmt-and-user-locale You'll probably need NSMutableURLRequest if you want cookies
|
# ? Feb 16, 2012 12:07 |
|
Carthag posted:As far as I can tell, NSDate is unaware of timezones, that all takes place in NSDateFormatter, so that might be it. Maybe this helps: http://stackoverflow.com/questions/2534757/nsdate-datefromstring-how-to-parse-around-utc-gmt-and-user-locale Aaaaahhhhh of course. I'm +8GMT, it all makes sense. So according to that I could add a category onto NSDate or whatever it is to add a [mydate nonRetardedDateAnswer] message that ensures +8 is being adhered to.
|
# ? Feb 17, 2012 01:09 |
|
The NSDate docs say you shouldn't rely on -description (which is what is called when you log it like that) anyway, and use NSDateFormatters whenever you want to show a date to the user. And actually I think NSDateFormatter by default uses your locale & timezone if you don't set anything, so I'm betting if you write out the date with a minimally configured formatter (basically just setting the format), it will display exactly as you need.
|
# ? Feb 17, 2012 02:01 |
|
When I create a simple Cocoa Application project, Xcode makes an 'AppDelegate.h/.m' and I put all the example code from a book in that code. I have an older book (Cocoa Programming with Mac OS X, focusing on 10.2?) and in that version of Xcode you must have had to make the delegate classes by hand or something. Anyway, is there a way I can connect outlets to SomeOtherClass.m? Do I have to let my program know I want to access methods in those other classes, so I can get the 'blue cube' for that class to appear so I can connect Outlets to my nib? I have newer books I just was curious to the answer to this question. I like this book (and am waiting for the new edition to come out), most of the stuff is still useful, it's just the initial setup and wiring up of the apps that gets weird.
|
# ? Feb 17, 2012 02:31 |
|
I'm not sure exactly what you mean. If you want to add one of your own custom objects to a nib, find the blue cube/'Object' in the object library, add it to your nib, and change the class in the identity inspector. If you want a class to be able to bind to other objects, you should add IBOutlets in the .h file. If you want to connect some object to the app delegate, there's a delegate outlet in the Application object in the nib file under Placeholders.
|
# ? Feb 17, 2012 02:44 |
|
Question about filtering an array on multiple criteria / parameters. Say I have an array of objects (returned form a Core Data fetch request, if that matters) with the properties name, color, hatSize and I am displaying them in a UITableView to the user. If I let the user filter by color, that's simple: poop out a filtered array: code:
I'm sure this is a problem / pattern that's been done a billion times but I can't the right terms, and I'm too dumb to see what will be the very obvious solution when someone takes pity on me and points it out.
|
# ? Feb 17, 2012 04:31 |
|
Lumpy posted:Question about filtering an array on multiple criteria / parameters. How about keeping an array of predicates and adding/removing them as the user adds or removes filters? Then just apply all of the predicates to generate your filtered array. It would probably be more efficient to store a list of conditions and create a single predicate that includes all of them, actually.
|
# ? Feb 17, 2012 08:24 |
|
Gordon Cole posted:How about keeping an array of predicates and adding/removing them as the user adds or removes filters? Then just apply all of the predicates to generate your filtered array. It would probably be more efficient to store a list of conditions and create a single predicate that includes all of them, actually. Thanks. I don't know how I missed NSCompoundPredicate while reading up on this, but your post made the light-bulb go on.
|
# ? Feb 17, 2012 15:34 |
|
I figure this may be the best place for this, as the Software thread is inundated with Mountain Lion talk for now and this seems more like a development-type question. I'm attempting to run some software (mlint utility of Matlab, if it matters), and it's generating the following error when I run it from the command line pre:mp@helios:~$ mlint dyld: Library not loaded: libtbb.dylib Referenced from: /Applications/MATLAB_R2011a.app/bin/maci64/libut.dylib Reason: image not found Trace/BPT trap: 5 pre:mp@helios:~$ otool -L /Applications/MATLAB_R2011a.app/bin/maci64/libut.dylib /Applications/MATLAB_R2011a.app/bin/maci64/libut.dylib: @loader_path/libut.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libmwi18n.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libmwfl.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libboost_date_time.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libboost_thread.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0) @loader_path/libicudata.dylib.42 (compatibility version 42.0.0, current version 42.1.0) @loader_path/libicuuc.dylib.42 (compatibility version 42.0.0, current version 42.1.0) @loader_path/libicui18n.dylib.42 (compatibility version 42.0.0, current version 42.1.0) @loader_path/libicuio.dylib.42 (compatibility version 42.0.0, current version 42.1.0) libtbb.dylib (compatibility version 0.0.0, current version 0.0.0) libtbbmalloc.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0) So, I guess there are two possible options: 1) Is it possible / worth it to edit the original dylib file to use @loader_path/libtbb.dylib instead? (I think this would fix it) 2) Is there some system variable I can set so to the parent folder so it will automatically find this dylib if the absolute path is not specified?
|
# ? Feb 17, 2012 20:12 |
|
Maybe look into the LD_LIBRARY_PATH environment variable or one of its ilk.
|
# ? Feb 17, 2012 20:15 |
|
Carthag posted:Maybe look into the LD_LIBRARY_PATH environment variable or one of its ilk. Ah. It was Modern Pragmatist fucked around with this message at 21:20 on Feb 17, 2012 |
# ? Feb 17, 2012 20:33 |
|
Don't know if this is the right place for this but does anyone use gfortran on their Mac? I had it installed and working previously but I haven't used it in about a year. Today I was trying to compile something and I get this error: gfortran: error trying to exec 'as': execvp: No such file or directory I've done some googling and the only suggestions I can really understand are to download the latest version of XCode as well as install the latest version of gfortran for Lion which I've done. Still get the same error. I'm not a computer scientist so I don't understand what this is trying to tell me. Anyone have any idea?
|
# ? Feb 18, 2012 22:33 |
|
The Born Approx. posted:Don't know if this is the right place for this but does anyone use gfortran on their Mac? I had it installed and working previously but I haven't used it in about a year. Today I was trying to compile something and I get this error: http://www.macresearch.org/error_trying_to_exec_as_execvp_no_such_file_or_directory says it cant find gcc (or 'as'). does 'which gcc' or 'which as' give any results? eg: code:
Also have you installed XcodeTools.mpkg ? that seems to be suggested on that page as well.
|
# ? Feb 18, 2012 23:44 |
|
Yeh gcc and as weren't installed in /usr/bin or /usr/local/bin for some reason, I had to go into XCode and download something called "Command Line Tools" for it to work, but it works now. Thanks!
|
# ? Feb 19, 2012 01:05 |
|
The Born Approx. posted:Don't know if this is the right place for this but does anyone use gfortran on their Mac? I had it installed and working previously but I haven't used it in about a year. Today I was trying to compile something and I get this error: as is the assemmbler gfortrans using in its compile toolchain, does gcc or any of that poo poo work?
|
# ? Feb 19, 2012 01:06 |
|
Anyone run into crashes trying to use guard malloc? I am debugging an iOS 5 app on the latest Xcode in the simulator. If I try to turn on guard malloc, my app crashes immediately in __dyld_dyld_start (before main() even executes) with zero information. I've tried all sorts of research on this and I can't get the drat thing to work. I'm targetting iOS 5 and am not weak-linking any libraries or doing anything else weird (that I can tell). Edit: this is really weird as this is a new iOS 5 project on the iOS 5 simulator. I am using restkit, I wonder if that is causing a problem... Edit2: Nope, brand new blank utility project template has the exact same problem. But running in the 4.3 simulator works just fine. There appears to be something broken in the 5.0 simulator environment. Also the actual crash point just says 0 <????> but the frames right before are _libxpc_initializer -> _xpc_domain_init_local -> mach_ports_lookup ->mig_get_reply_port -> <????> Edit3: A lot of people who are getting this crash are weak-linking libSystem.B.dylib which apparently is no-good on the iOS 5 simulator. They changed to -weak-lSystem which apparently links the correct version of libSystem for the simulator vs the device. However libgmalloc.B.dylib references libSystem.B.dylib (according to otool) so perhaps Guard Malloc really is just horribly broken on the iOS 5 simulator. Simulated fucked around with this message at 20:01 on Feb 19, 2012 |
# ? Feb 19, 2012 01:43 |
|
I don't have an answer except why aren't you using NSData?
|
# ? Feb 19, 2012 06:19 |
|
I'm using the new appearance features in iOS 5, and I can't figure this one out. I have a UISegmentedControl which I setUserInteractionEnabled:NO when a segment is chosen to prevent slowdown and accidental multi-taps. Now that I have custom images, though, this happens: Normal view: Then tap on a different segment (for example, Load / Save): The default UISegmentedControl will have the Load / Save segment selected when it changes the alpha to indicate setUserInteractionEnabled:NO. Now, all of them grey out. It's a bit jarring. Am I missing an image to set with UIBarMetrics? Setting the 'disabled' image just makes all of them the same.
|
# ? Feb 19, 2012 18:00 |
|
Nevermind. I just figured out I can set each segment individually. That works.
|
# ? Feb 19, 2012 18:14 |
|
Core Data question: I read the guides but there are so many my brain hurts, so I just want confirmation on something that I think is right. Say I fetch a list of managed objects, show them to the user. User taps on a row and I move to a detail screen, passing a reference to the object anObject associated with the row they tapped. On this screen the user can edit some property; say name They then press a button move to the next screen, again, passing a reference to anObject, and here the user could edit some other property if they wanted, but instead, they hit the 'cancel' button, which should un-do any changes to anObject and zip them back to the list. Since I have not saved the context, no changes were made to the local store, so I should do: code:
and then I can release my reference to anObject and all is well. I cannot do code:
Because the list screen still is showing it, yes?
|
# ? Feb 20, 2012 00:48 |
|
I just updated Xcode from the MAS and then it told me that I need to install the Command Line Tools because they're not installed by default. I don't have a developer account so I didn't install it, but I still have access to things like gcc, clang, make, and other Unix tools located in /usr/bin. What exactly am I missing here?
|
# ? Feb 22, 2012 00:10 |
|
|
# ? May 16, 2024 18:46 |
|
Xcode no longer installs anything by default in /usr, but it won't blow things away that previous installs have put there. You don't need anything in /usr at all if you work exclusively within Xcode and its build system, but if you also want to be able to (e.g.) work on open-source Unix software with a Makefile-based build system, you should install the command-line tools. Contrariwise, if you never use Xcode and its build system, you can now just install the command-line tools without needing a full Xcode package.
|
# ? Feb 22, 2012 02:30 |