0

我制作了一个启用 ARC 的应用程序(我的第一个应用程序),分发(而不是通过应用程序商店)并开始收到报告说它在某些 Mac 上崩溃了。在他们的帮助下尝试和搜索后,我们发现问题在于他们有一个 32 位处理器。所以我禁用了 ARC,将构建设置为 x86_64 并收到大量错误消息。

所有这些都已排序,现在我留下了大量警告(黄色警告)。我担心我会忘记一些东西,把记忆弄得一团糟。您认为从 64 位应用程序升级到 32/64 位应用程序的最佳方式是什么?如果有许多与其不兼容的mac,为什么首先使用ARC?

谢谢!

- - -更新 - - -

根据要求:

 Update to recommended settings

 Property 'delegate' requires method 'delegate' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

 Property 'delegate' requires method 'setDelegate:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

 '__bridge' casts have no effect when not using ARC

 Variable 'loc_tip' is used uninitialized whenever 'if' condition is false

 Variable 'loc_tip' is used uninitialized whenever '&&' condition is false

 Conflicting parameter types in implementation of 'tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:': 'NSInteger' (aka 'int') vs 'long'
4

1 回答 1

2

前方的大水

所有这些都已排序,现在我留下了大量警告(黄色警告)。

调高警告级别。把它们都修好。

我担心我会忘记一些东西,把记忆弄得一团糟。

您认为从 64 位应用程序升级到 32/64 位应用程序的最佳方式是什么?

担心是自然的,考虑到问题。

一种快速解决方法是使用启用垃圾收集的 ObjC。这样做并相信它会在没有额外更改的情况下工作是一个错误(阅读:您应该保留大量时间用于测试和寻找错误)。

the other approach, if you really want good support on both 32 and 64, would be to use MRC -- but you should just commit to MRC for both 32 and 64 bit in that case (no ARC). of course, this will require a lot of reviewing, fixing, manual testing, and testing for leaks (unless your program is small). this is the preferable solution for an app with good long term support and high quality standards, IMO.

why is ARC used in the first place if there are many macs that aren't compatible with it?

there really aren't a whole lot of macs out there that require 32 bit. if you were releasing a 1.0 today, you should just consider making it 64 bit only.

32 bit should have been supported and tested from the beginning of development, if it was a requirement -- either the ARC option or 32 bit would have been eliminated very early on. it seems odd that this oversight would slip through testing and development.

Update to recommended settings

Hit "Validate Settings", review, perform changes.

Property 'delegate' requires method 'delegate' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

echo warning message

Property 'delegate' requires method 'setDelegate:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

echo warning message

'__bridge' casts have no effect when not using ARC

you would just use a c-style cast in that case

Variable 'loc_tip' is used uninitialized whenever 'if' condition is false

ARC does this for you. just do what ARC would do:

NSSomething * loc_tip = nil;

Variable 'loc_tip' is used uninitialized whenever '&&' condition is false

echo previous response

Conflicting parameter types in implementation of 'tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:': 'NSInteger' (aka 'int') vs 'long'

the selector's declaration does not match -- copy the declaration from the header (NSTableView.h) and see if that change (of parameter types) requires any other changes to your implementations.

于 2013-03-07T19:03:05.907 回答