Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
dizzywhip
Dec 23, 2005

So I'm trying to do some basic audio programming in Cocoa (OS X, not iOS) and I'm having a lot of trouble. I'm totally new to audio programming, so it'd be nice to have a nice, simple walkthrough on how to do some basic tasks, but Apple's audio documentation is pretty awful.

Specifically, I want to generate some MIDI data and play it back with standard MIDI instruments. The only concrete example I can find that does what I want is this. That works fine I guess, but it doesn't really explain what it's doing for the most part. I can follow by example well enough, but I feel like I don't really understand half of it.

I'm also not really happy with this code in that the MIDI events need to be generated in real time. I was hoping to generate a bunch of midi data beforehand and then pass that off somewhere to play.

I'm sure I would have found something on Google if it was out there, but if anyone knows of any resources that focus on getting started with this stuff from a total beginner's perspective that would be awesome. Or if there's some kind of higher-level audio framework I could use that would be great too. Everything I found seemed to be really out of date though.

Adbot
ADBOT LOVES YOU

dizzywhip
Dec 23, 2005

So this isn't specific to Apple development, but I'm working on a music-related app that renders a musical score. That of course means I need to draw lots of musical symbols, so I've been looking into music fonts. There's one called Petrucci that seems to have been originally created long ago to be the default font for Finale. I'd love to use it, but I'm totally clueless about licensing issues.

Googling the font brings up a bunch of sites that have the font freely available for download. However, I can't find any licensing information about the font at all. I assume it's not okay to just use the font in a commercial app, but I'm not really sure. I'd be willing to pay a bit for a commercial license for the font (or any other quality music font) but I can't seem to find any information on how to do so.

Does anyone have any experience with this?

dizzywhip
Dec 23, 2005

NOG posted:

I wouldn't risk it. You should take a look into MusiQwik fonts. Will these work for you? Check out the OFL License on this link below. I'm pretty sure you would freely be able to use this in commercially sold software.

http://cg.scs.carleton.ca/~luc/allgeyer/allgeyer.html

Hmm...MusiSync may be usable, but I'm concerned that it doesn't have enough symbols. I'll look into it though, thanks!

xzzy posted:

I don't have experience licensing fonts for games, but I've done it in the publishing and printing world. Someone, somewhere, owns the copyright to that font. They're probably buried under a mountain of google results that let you have it for free, but they are out there. Hard part is that most licenses (like if you bought them from Adobe), it's a per-computer license. You have no privileges to distribute it.

Odds are good that you could use it without license and never get caught, but be in a world of hurt if you do get caught.

A quick google for musical notation fonts turned up this:

http://www.music-notation.info/en/compmus/musicfonts.html

Which at least lists who owns the copyright, so you can contact them for information.

That's a very useful list, thank you! I suppose I can get in touch with some of these people and see if I can work something out.

dizzywhip
Dec 23, 2005

Try initWithFormat: instead of initWithString:. The former works like printf, which seems to be what you want, and the latter just takes in a single string argument. Check out the documentation for details:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html

dizzywhip
Dec 23, 2005

NOG posted:

In Flash, you can normalize a velocity by using this: vel.normalize(speed). But in Objective C or Cocos2d, what is built in? I know of ccpNormalize(vel), but I don't understand how I can make it work like the Flash one. I guess if I knew more about normalization I'd just do the math, but is there anything built in?

Normalizing a vector scales it so that it has a magnitude of 1. I presume that the speed parameter in that normalize method is to scale the vector after normalizing it. You can achieve the same effect in the second example by scaling the vector manually after normalizing it. Just multiply each component of the vector by the speed, as in:

code:
ccpNormalize(vel);
vel.x *= speed;
vel.y *= speed;
That's certainly what the flash function does internally anyways.

dizzywhip
Dec 23, 2005

NOG posted:

That's what was stumping me, I thought I was doing that and it resulted in acting crazy.
I ended up doing this:

code:
//get a direction
CGPoint dir = ccpNormalize(heroVelocity);
		
//then use ccpMult to the direction with a speed
heroVelocity = ccpMult(dir, heroSpeed);

Ahh, well it looks like ccpNormalize returns a new normalized point rather than normalizing the point you pass in. Given that that's the case, just saying ccpNormalize(vel) isn't going to do anything, so the previous code would just cause the velocity to grow really fast. That's probably what was causing the crazy behavior.

dizzywhip
Dec 23, 2005

wellwhoopdedooo posted:

Or even being able to see what the gently caress column you're on at all. Seriously. What code editor, other than Xcode, offers NO goddamn way to see what column you're in? It's loving baffling.

I'm sure you've seen this option already, but just in case, if you're just trying to do manual line wrapping at a certain column, you can set a page guide in the preferences that will gray out everything past that column.

Probably the biggest annoyance for me, other than the broken git integration, is the keyboard shortcut situation. Xcode lets you set your own keybinds for a lot of the shortcuts (which is an awesome feature), but some of them are missing (like pushing repository changes), and one of the commands arbitrarily won't let me set the shortcut I want.

The jump to next/previous counterpart shortcuts used to be Command + Alt + Up/Down in Xcode 3. In Xcode 4 they changed Alt to Command for some reason, which is a much more awkward key combination. I also use Command + Alt + Left/Right to switch tabs, so it would work out nicely if I could use the same modifier keys for switching between header and implementation files. But for some reason, Xcode 4 doesn't let me set that particular key combination for that particular command. It'll let me set it to whatever else I want, and I can set other commands to that key combination, but it just refuses to work in that specific situation.

Fortunately, I discovered recently when I upgraded to a new MBP with a multi-touch trackpad that you can jump to previous or next counterparts with a three-finger up or down swipe.

Other than that issue, I think the two biggest things I'd like to see in Xcode are improvements to the tabbed interface and a minimap like Sublime Text has. On higher resolution screens there's a lot of unused real estate on the right side of the text editor that would be perfect for a minimap.

Overall though I think Xcode 4 is a huge improvement. The interface is incredibly slick, and the code completion and live error checking is really great.

dizzywhip
Dec 23, 2005

Ender.uNF posted:

Are you kidding? With the left and right bars open and the assistant view on there is absolutely no space. Using the assistant while editing an iPad XIB is almost useless and I have a 1920x1280 MBP.

I guess I need to setup a workspace with a second monitor.

Well I'm talking about having source files open, not XIBs. I have a 1680x1050 MBP and with the file browser open and lines wrapped at 120 characters, about a quarter of the screen is just empty on the right.

dizzywhip
Dec 23, 2005

drawPlayingField isn't in the code you posted, so we can't see what it's doing.

dizzywhip
Dec 23, 2005

This should be a good place to start: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html

I've never worked with drag and drop, but from what I understand it's closely linked to the copy paste system.

dizzywhip
Dec 23, 2005

stray posted:

Hm... that seems like drastic overkill. I don't need to create numbers you can dial from everywhere on Earth (yet); I just want to turn the number that I'm reading in from a plist into a nicely-formatted string that I can pump out to a UILabel. (I'm taking baby steps right now.)

This should be pretty easy. Objective-C makes it quite a bit more cumbersome than other languages, but it's still fairly simple.

If you're certain you have a 10 digit integer, you can do something like this:

code:
NSString* phoneString = [NSString stringWithFormat: @"%d", phoneNumber];

NSString* formattedPhoneString = [NSString stringWithFormat: @"(%@) %@-%@", 
                                           [phoneString substringWithRange: NSMakeRange(0, 3)],
                                           [phoneString substringWithRange: NSMakeRange(3, 3)],
                                           [phoneString substringWithRange: NSMakeRange(6, 4)]];
Edit: Just noticed you have an 11 digit number, but the same concept applies.

dizzywhip
Dec 23, 2005

I have almost no experience with this, but I'm pretty sure that Cocoa Bundles are exactly what you're looking for.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/LoadingCode/LoadingCode.html%23//apple_ref/doc/uid/10000052-SW1

dizzywhip
Dec 23, 2005

I've been having a lot of trouble with the transition from plain NSViews to Core Animation layers.

I have a custom NSView subclass for the main content area of my application. Think of it as being similar to something like the text editing area of Xcode or any other text editor. Basically, it contains some user-editable content, and the view needs to get taller or shorter based on how the content changes.

I have this working perfectly fine as a standard, non-layer-backed NSView. But I now want to add some Core Animation functionality like animating some components of the content and overlaying layers on top of the content. I've been trying to get this working for quite a while, but I keep running into issues, and I think I'm just not grasping how to properly work with layers in this context.

The main problem I'm having is that in certain situations, when the view resizes itself, the sizing of the layers doesn't seem to stay in sync. So when the view gets taller, for example, the content will be drawn stretched out.

What I'm doing is basically this:

  • Create view's layer and add several sublayers to it.
  • Set delegate of sublayers to the view itself, so that it can draw the layer content.
  • When an action occurs that requires redrawing a layer, call setNeedsDisplay on that layer.
  • Inside the delegate layer drawing method, calculate the content layout, which will resize the enclosing view if needed.
  • Redraw content to the layer.

This is pretty much how I did things before I started doing layers, except that I'd call setNeedsDisplay on the view itself and I'd do the layout and drawing inside drawRect.

The seemingly obvious solution would be to calculate the layout earlier, but I haven't had any luck with that either. I've tried watching WWDC videos, and I've read a lot of documentation, but it never really seems to cover this particular case.

Basically, I'm wondering how you guys would approach this problem. I've been stumped for quite a while. Any advice would be appreciated!

I'm also curious, is there any reason to enable layers in the view's parent views? The view is in a ScrollView which is in a SplitView and so on. Should any of those have layering enabled?

A.S.H. posted:

So I am talking to my landlord, and he wants to make a calendar app, but not just any calendar app or I wouldn't be posting in here. It's a religious calendar, apparently he's in a community that's related to Russian Orthodox but part of an Old Worship Sect, something of that nature. The bottom line is he wants to provide his community with this App for religious observances, like on certain holiday's they aren't allowed to produce income, that sort of daily doctrine. The last offer he got from someone to make this App was $15,000 which sounds a little steep for a calendar. My landlord is going to photocopy the calendar for this year, and create a written outline of specific observances, I'm hoping that is sufficient data to get this off the ground. Please reply to this post or send me a PM if you are interested in taking on this project.

Why not just make a shared calendar in iCal? That can be used in the iPhone calendar app, and unless there's some special functionality he needs, that should work fine.

dizzywhip
Dec 23, 2005

So I've made some progress on the issue I posted about earlier. To remind you guys, my problem is basically that I have a layer-backed view whose size changes periodically, and I'm having issues with the layer content getting stretched and distorted as the view's size changes. I've discovered the cause of the issue, but I can't figure out how to properly solve it.

The size of the view is calculated and set in a relatively expensive layout method. Back before I started using layers, I would just call this layout method at the beginning of drawRect right before I started drawing, and everything worked fine.

Now, since I'm using layers, I don't use drawRect anymore and instead use drawLayer:inContext:. It turns out that setting the view size within that method causes the stretching. For example, if the view gets taller in that method, the layer content will be drawn stretched out vertically. This happens even if I set the layer's frame to match the enclosing view's frame.

The good news is that everything works fine if I instead calculate the layout at the same time that I call setNeedsDisplay on the content layer. The bad news is that within a single event loop I might be calling setNeedsDisplay on the layer several times depending on the event, and I have no way of reliably predicting whether any particular call is the last one of the event loop. Since my layout method is somewhat expensive, it's very wasteful to call it multiple times for a single redraw.

So basically I need to somehow hook into the span of time between the final time I call setNeedsDisplay on a particular layer and the subsequent drawLayer method. Anyone have any ideas on how to do that?

tl;dr: Is there any way to get a notification or callback or whatever when the event loop is finished, but before things are redrawn?

dizzywhip
Dec 23, 2005

Actually, yes, that seems to work great! I had looked at setNeedsLayout, but I think I misinterpreted how it worked and I didn't think it was gonna work for me. Thank you for the suggestion, this problem has been bugging the crap out of me for a very long time!

dizzywhip
Dec 23, 2005

I'm getting the following strange memory errors in my project that I can't figure out:

code:
malloc: auto malloc[3688]: attempted to remove unregistered weak referrer 0x102748e90
malloc: auto malloc[3688]: attempted to remove unregistered weak referrer 0x102748ee0
I've done a bit of diagnosing, but now I'm stuck.

First off, this is a standard Mac cocoa app using garbage collection. The error occurs infrequently (but consistently) when a CALayer object is being created within a particular method in my project, and the messages always come in pairs. Here's an example of a call stack when the error is logged (linked for huge).

In that particular call stack the error is being logged from a layer being created as the backing layer of a subview I'm creating. But the error can also happen when I'm just doing something like CALayer* layer = [CALayer layer].

Clearly it's a garbage collection issue, but I don't see what I could be doing wrong that could be causing this issue. The error is only occurring when this particular method is called (layers created elsewhere in the app haven't ever had this problem), so it also seems to be specific to this particular context. But again, I have no idea what's wrong.

It doesn't seem to have any noticeable effect from the user's perspective, but I'd still like to get rid of it. Anyone have any ideas on what might be causing it?

dizzywhip
Dec 23, 2005

Godspeed You! Black Conservative posted:

Good news everyone, TextMate 2 alpha is out tomorrow!

:aaa: Where did you hear about that? I don't see anything on the Macromates blog or twitter.

dizzywhip
Dec 23, 2005

I want to put a simple little video tutorial window into my Cocoa app, so I'm using QTMovieView from the QTKit framework. It works pretty well, except that the playback controls are the poo poo ones you used to see on QuickTime movies inside browsers a few OS revisions ago.

I'd like to instead have the nice floating controls that you see in QuickTime Player and iTunes, but I can't figure out if there's a way to get them without completely reconstructing them myself. I found one forum post saying that you need to recreate them, but I use an app that has built-in video tutorials and has the nice controls. They're identical to the QuickTime Player controls as far as I can tell, down to the glow you get when holding down the mouse on the buttons. I doubt they painstakingly recreated every detail of those controls just for some tutorial videos, but I guess it's possible.

Anyone have any experience with this?

Edit: Contacted the developer of that app and it turns out they did recreate it from scratch. Pretty lame, Apple should really be better about making standard UI elements available to everyone. I've already meticulously recreated the Safari tab bar, and I don't look forward to having to recreate this too for such a minor feature.

dizzywhip fucked around with this message at 06:39 on Dec 26, 2011

dizzywhip
Dec 23, 2005

Speaking of bad books, I'd steer clear of the Core Animation book by Marcus Zarra and Matt Long for the same reasons as above. The flow is totally weird, the first couple chapters start giving you a bunch of examples without explaining anything or giving a proper introduction to the API, and most of what I've seen so far is more or less just repeating the official documentation.

dizzywhip
Dec 23, 2005

I'm having an annoying issue with getting text to center smoothly. I have some numbers that I'm trying to draw centered inside some circles, and depending on the size of the circle (which scales with the size of the view), the number will usually be off by a couple pixels horizontally, vertically or both. An example:





The number jitters around as the view is resized. I think the problem might be that the position of the text is getting rounded off to the nearest integer.

Does anyone know how to draw text at a sub-pixel position or have any other ideas on how to get the numbers to stay in place? I'm just using NSString's drawInRect:withAttributes: method with a center-aligned paragraph style and manually centering the rect's vertical position. Also this is on OS X, not iOS.

dizzywhip
Dec 23, 2005

pokeyman posted:

Check out CGContextSetShouldSmoothFonts and CGContextSetShouldSubpixelPositionFonts. You can use [[NSGraphicsContext currentContext] graphicsPort] in your -drawRect: to get access to a CGContext.

That sounds like exactly what I need! I'll check it out when I get home. Thanks!

Edit: No luck :( It seems to have no effect.

dizzywhip fucked around with this message at 05:38 on Jan 11, 2012

dizzywhip
Dec 23, 2005

pokeyman posted:

Is the background transparent? I think it needs to be at most semitransparent for subpixel rendering to happen.

It's totally opaque. I don't know if it matters for this particular situation, but I should mention that I'm using a non-layer backed view. I know layer-backed views have weird issues with doing sub-pixel text rendering, but those shouldn't apply here.

dizzywhip
Dec 23, 2005

Carthag posted:

Cocoa With Love had a post that might be helpful, it includes positioning a glyph:

http://cocoawithlove.com/2011/01/advanced-drawing-using-appkit.html

I actually stumbled upon this post a couple days ago while researching a different problem but I skipped over the character part :downs:. I won't be able to try this until later, but this looks like it'll work for sure since you're drawing the path yourself.

dizzywhip
Dec 23, 2005

Carthag posted:

Cocoa With Love had a post that might be helpful, it includes positioning a glyph:

http://cocoawithlove.com/2011/01/advanced-drawing-using-appkit.html

Success! It's a lot of code but it works perfectly. Thanks a bunch.

dizzywhip
Dec 23, 2005

Carthag posted:

So I could get at the owner, and thereby access properties on AuxObject.

He asked when, not why.

dizzywhip
Dec 23, 2005

Do you ever reference your window directly through the window controller? I've run into weird issues when using NSWindowController where unless you actually try to access the controller's window it won't get set up properly.

dizzywhip
Dec 23, 2005

quote:

Here's a possibly dumb question: Assuming I am going to back off and build my knowledge of C or Python, can I still use Xcode for both of those languages? I'm guessing C: yes and Python: no. In fact now that I look more closely at the Python site I'm sure of it.

I believe that Xcode supports custom build scripts, so you could in theory use it to write Python, but I wouldn't really recommend it. It'd be better to use a more lightweight text editor like Sublime Text or TextMate along with the command line.

Actually, an app I came across recently called CodeRunner would be pretty good for starting out. It seems aimed towards beginners and lets you run your code directly inside the app. It's a lot cheaper than Sublime Text and TextMate too.

Even if you do go with CodeRunner you should still learn how to compile and run your code via the command line.

dizzywhip
Dec 23, 2005

LP0 ON FIRE posted:

Is it safe to call just [self methodName:] on a method that has only a BOOL parameter? I'm using it on a selector in Cocos2D like this: id actionRestoreEnergy = [CCCallFuncN actionWithTarget:self selector:@selector(restoreHeroEnergy:)];

The only reason I want to do it this way is because that selector doesn't need to send a YES message in that particular instance, and I don't feel like doing all the data stuff and changing my method because it seems like it does the same thing as long as it's not causing leaks to memory and such.

If the value of the argument doesn't matter, why not just pass in an arbitrary value instead of not passing anything and hoping it works? If you want to make it clear that the parameter doesn't matter in this case, make another method called restoreHeroEnergy that doesn't take any argument and just calls the actual method with a default value.

edit:

quote:

edit: Actually this is bad because it is always returning YES with just restoreHeroEnergy:

I imagine that what's actually happening is that self is being passed in as the parameter, which evaluates to true since it isn't null. If you need the value of the parameter to be NO then just pass in NO.

dizzywhip fucked around with this message at 19:39 on Feb 3, 2012

dizzywhip
Dec 23, 2005

I've never used Cocos2D so I'm probably missing something here, but what's the purpose of calling the method that way rather than doing [self restoreHeroEnergy: NO]?

dizzywhip
Dec 23, 2005

I'm having a really bizarre issue with NSPopover. I noticed recently that my popovers had stopped animating when they're opened or closed, and I narrowed the cause down to when I changed my app's bundle identifier. When I set the identifier to what it used to be, the popovers start animating again, and when I change it back they stop.

I have no idea why that would affect something like this. There are no references to the old identifier anywhere in my project, and it's affecting popovers that were created both before and after the change.

Does anyone have any idea why this could be happening?

dizzywhip
Dec 23, 2005

I actually just figured it out after I realized the animation would work for any identifier different from my current one. It requires a bit of background to explain though.

A while back I needed to put a color picker in my app, but I hate the lovely floating window the default color picker sits in, so I decided to try and put the color picker into a popover.

It's kind of janky, but basically I'm ripping out the contents of that window and just putting them into a view that gets used by the popover. It actually works really well, except that I'm using the color picker with a color well, and when you click on the color well it tries to summon the picker window. I'm getting around that by overriding the activate method of NSColorWell to immediately hide the window as soon as it's summoned.

The problem with that is that in Lion, the window animates as it's being opened and closed, so you see the window flash on screen for a moment. I've gotten around that by disabling window animations temporarily when the panel gets opened and closed:

code:
- (void) activate: (BOOL)exclusive {
	BOOL defaultAnimationSetting = [[NSUserDefaults standardUserDefaults] boolForKey: @"NSAutomaticWindowAnimationsEnabled"];
	
	[[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"NSAutomaticWindowAnimationsEnabled"];
	[super activate: exclusive];
	[[NSColorPanel sharedColorPanel] orderOut: self];
	[[NSUserDefaults standardUserDefaults] setBool: defaultAnimationSetting forKey: @"NSAutomaticWindowAnimationsEnabled"];
	
	[popover showRelativeToRect: self.bounds ofView: self preferredEdge: NSMinYEdge];
}
The problem, I guess, is that at some point the animations got disabled but somehow didn't get reenabled, and the saved preference was associated with my app's bundle ID.

I think I'm just going to write my own color well class to avoid this whole situation.

dizzywhip
Dec 23, 2005

Isn't this exactly the sort of service that Apple just warned developers to never use? How do you generate your app store reviews?

dizzywhip
Dec 23, 2005

WARnold posted:

Nope, Apple's warning was about the service in the Toucharcade post. (some company created a network of download bots that downloaded the poo poo out of apps to get them to the top ranks.)

We do no such thing. Instead we have a handful of reviewers who download the app, take a look, and write reviews on app store.

We do not manipulate rankings, and will never do so.

How is downloading an app and giving fake reviews not manipulating rankings?

dizzywhip
Dec 23, 2005

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.

dizzywhip
Dec 23, 2005

What errors is it giving you?

dizzywhip
Dec 23, 2005

duck monster posted:

Yes.

Basically what I'm doing is pulling a structure out of a web server using CJSON (Touchjson or whatever) and saving it in the root, uh app delegate thingo, pulling some variables out to display, letting the user gently caress with the variables, and then trying to modify the structure so I can re-serialize it and send it back. Business app on a very short contract.

It appears my cunning plan has hit the rocks :(

I modified all instances on NSDictionary and NSArray to NSMutabledictionary and NSMutablearray or whatever it is, including in touchjson, but its still acting like a total shitbag.

Is there some sort of mutable deep copy I could use, since i think the problem is that this structure is just not producing mutable members of the dictionary.

I'm honestly mystified why they didnt implement dictionaries so that there was an option to be mutable or non mutable, rather than two separate subtly incompatible objects with a preference for the non-useful variant.

Keep in mind that the mutability of the array or dictionary doesn't have anything to do with the mutability of the objects inside of it. When you say it's "not producing mutable members of the dictionary" it sounds like you're actually trying to modify the objects in the containers rather than the containers themselves. Since the data came from JSON I assume those values are NSStrings or NSNumbers, both of which are also immutable. So even if you put all of those objects into mutable containers, in order to change their values you're going to have to replace those immutable strings and numbers with new objects.

I think the "proper" way to handle this sort of situation is to have some model classes that conform to the type of data you're getting back from the server. They can implement an initWithJson: method that takes in the raw objects and stores them however you want, probably in a mutable format.

Also, [NSMutableDictionary dictionaryWithDictionary: dictionary] and [NSMutableArray arrayWithArray: array] might be helpful to you.

duck monster posted:

Would sticking a category on NSDictionary carry across onto NSMutableDictionary?

I'm not 100% positive but I would assume so since NSMutableDictionary inherits NSDictionary.

dizzywhip
Dec 23, 2005

Why would you want to replace every int with an NSNumber? That would introduce a bunch of overhead for no reason. Typically the only time I ever use them is when I need to store numbers in a container class that only stores objects.

dizzywhip
Dec 23, 2005

pokeyman posted:

And since it already requires Lion it's not like you're leaving anyone behind.

Should be as easy as hitting 'Refactor -> Convert project to ARC...'

Are there any risks to using that utility or is it pretty much guaranteed to work? The app I'm working on right now uses garbage collection and I was planning on switching to ARC at some point. It'd be nice if I could just run that and be done with it.

dizzywhip
Dec 23, 2005

I'm using version control, of course, I just wasn't sure if the tool could potentially produce subtle bugs or memory leaks that could come back to haunt me down the line. It sounds like it's pretty safe to use so I'll give it a shot later.

Adbot
ADBOT LOVES YOU

dizzywhip
Dec 23, 2005

rjmccall posted:

Also, the current utility is really designed for migrating manual retain/release code to ARC rather than migrating GC code. If you have the Mountain Lion seed available, that might be of interest.

So the utility in Mountain Lion's Xcode is better at converting GC code? If that's the case I'll just hold off until I start working with Mountain Lion. If the current utility doesn't handle retain cycles well, that could definitely cause a lot of issues with my current code.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply