Hoookay,
所以我知道我要打十几个"加载lib dummy"的答案,但是这里......
junk.framework正在导出另一个项目的某些对象(junk.app),所以我可以在集群上的remote.app节点上使用它.我可以编译junk.framework(我意识到动态加载不再意味着什么)并编译并链接remote.app到junk.framework.
但是,当我运行remote.app时,我得到了一个错误的可爱宝石:
dyld: Library not loaded: @executable_path/../Frameworks/libtiff.dylib
Referenced from: /Users/slate/Documents/junk/build/Development/junk.framework/Versions/A/junk
Reason: image not found
Run Code Online (Sandbox Code Playgroud)
我认为发生的事情是junk.framework正在从某个位置加载libtiff.dylib并且无法找到它.junk.framework是我正在研究的另一个项目,我只需要构建(最后).
当我get info在我的垃圾目标中使用libtiff.dylib时,它给了我/Users/slate/Documents/osirix/osirix/Binaries/LibTiff/libtiff.dylib一条路径...而且我已经被absolute path选中了.那么为什么不寻找呢?
呃...为什么要看@executable_path /../ ???? 那个地方到底是什么设置所以我可以改变它?
编辑---
otool -L给了我这个:
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.26.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.54.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@executable_path/../Frameworks/libtiff.dylib (compatibility version 11.0.0, current version 11.4.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, …Run Code Online (Sandbox Code Playgroud) 我正在构建一个商业应用程序,我们正在使用一些GPL代码来帮助我们.
我如何添加#warning或#error声明,以便在为调试构建代码时,它会发出警告,但是当我们构建发布时它会抛出错误?
我可以:
#warning this code is released under a CCL licensing scheme, see Source_Code_License.rtf
#warning this code is not LGPL-compliant
#warning this code was copied verbatim from a GP Licensed file
Run Code Online (Sandbox Code Playgroud)
在文件的开头,但我可以做得更好吗?如果包含文件,是否有更好的标记文件的方法?
我正在使用带有gcc或clang的Objective-C++.
我收到了这个错误
System.MissingMethodException: Method not found: 'System.Type.op_Equality'.
Run Code Online (Sandbox Code Playgroud)
运行构建时.(可能是因为我在Android模拟器上,JIT正在捕捉它.)
建设时我收到这些警告:
Target ResolveAssemblyReferences:
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/Microsoft.Common.targets: warning : Reference 'Mono.Android' not resolved
For searchpath {CandidateAssemblyFiles}
Warning: {CandidateAssemblyFiles} not supported currently
For searchpath {HintPathFromItem}
HintPath attribute not found
For searchpath {TargetFrameworkDirectory}
Considered target framework dir /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0, assembly named 'Mono.Android' not found.
For searchpath {PkgConfig}
Considered Mono.Android, but could not find in any pkg-config files.
For searchpath {GAC}
Considered Mono.Android, but could not find in the GAC.
For searchpath {RawFileName}
Run Code Online (Sandbox Code Playgroud)
我在我的Mac上安装了Mono for Android和MonoTouch.这可能覆盖了一些设置吗?
我也将这些作为警告:
Target ResolveAssemblyReferences:
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/Microsoft.Common.targets: …Run Code Online (Sandbox Code Playgroud) 林有一个麻烦加载PDF的UIWebView一个内部时Scrollview具有分页启用,只是不能让我的头周围.
所以,我开始与现有的苹果开发者,一旦做到这一点我装,而不是一个标签在寻呼示例代码ViewController一个UIWebView加载PDF文件.它确实有效,但在设备上有很多错误,包括旋转和缩放.
在iOS 5上缩放根本不起作用它缩放但是滚动到顶部并且不允许我移动到内部UIWebView所以当我移动时我做的唯一的事情是在不在内部的页面之间移动UIWebView.使用iOS 4它确实让我移动但是在旋转设备时有很多麻烦,它不会刷新UIWebView内部到新帧(即使我确实改变了帧didRotate method),所以我想知道是否有另一种方法加载UIWebView与缩放兼容的PDF 和使用UIScrollViewwith Paging 旋转的PDF .
或者在加载UIWebView内部时我应该考虑什么UIScrollView?我必须启用的功能或我缺少的东西?
因为在开始时我认为它是iOS 5上的一个错误并且我在旋转时做错了(这可能是我无论如何)但我在我的iPad上有几个应用程序与ios 5做同样但完全没有问题.
我希望你能指出我正确的方向.提前致谢!
另一个可能是愚蠢的风格问题:
并发应该如何锁定?执行者或调用者应该负责锁定线程吗?
例如没有特定的语言......
Caller::callAnotherThread() {
_executor.method();
}
Executor::method() {
_lock();
doSomething();
_unlock();
}
Run Code Online (Sandbox Code Playgroud)
或者
Caller::callAnotherThread() {
_executor.lock()
_executor.method();
_executor.unlock()
}
Executor::method() {
doSomething();
}
Run Code Online (Sandbox Code Playgroud)
我对线程和锁定知之甚少,所以我想确保代码是健壮的。第二种方法允许线程不安全调用...从技术上讲,您可以在不执行任何锁定的情况下调用 _executor.method()。
帮助?
谢谢,
在我的应用程序目前我正在使用
#if DEBUG
Console.WriteLine(....)
#endif
Run Code Online (Sandbox Code Playgroud)
在许多地方.这是一个临时措施,并且很好,但是我想知道我应该如何正确地做到这一点.有人在传递过程中向我简要提到了NSLog,但我找不到任何Monotouch和NSLog信息,而且我不确定这些信息是如何可检索的,以便我可以看到发生了什么.
最后,如果有人使用任何特定的策略进行崩溃扣除和堆栈追踪抓取,我会全力以赴.
我正在NSFetchedResultsController使用以下获取请求创建一个viewDidLoad
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:NSStringFromClass([Person class])];
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:NSStringFromSelector(@selector(sortDate))
ascending:NO]];
NSFetchedResultsController *controller = [[NSFetchedResultsController alloc] initWithFetchRequest:request
managedObjectContext:self.mainManagedObjectContext
sectionNameKeyPath:nil
cacheName:nil];
controller.delegate = delegate;
NSError *error;
if (![controller performFetch:&error]) {
NSLogError(error);
}
// Connecting up all the delegates for UITableView
Run Code Online (Sandbox Code Playgroud)
而在重装它viewWillAppear与[self.tableView reloadData]
简化 Person
@interface Person : NSManagedObject
/// an NSTimeInterval representing the Unix Epoch
@property (nonatomic, retain) NSNumber *sortDate;
- (void)viewed;
@end
@implementation Person
// nothing fancy or custom - no extra …Run Code Online (Sandbox Code Playgroud) 我可以重现以下C#/ .NET:
//A
String.Format("There are {0} cats in my {1} and no {2}", 2, "house", "dogs");
Run Code Online (Sandbox Code Playgroud)
在Objective-C/Cocoa中:
//B
[NSString stringWithFormat:@"There are %d cats in my %@ and no %@", 2, "house", "dogs"];
Run Code Online (Sandbox Code Playgroud)
但我不能这样做:
//C
String.Format("I have {0} dogs in my house. My {0} dogs are very nice, but it is hard to walk {0} dogs at the same time.", numDogs);
Run Code Online (Sandbox Code Playgroud)
在Objective-C中:
//D
[NSString stringWithFormat:@"I have %d dogs in my house. My %d dogs are very nice, but it is hard …Run Code Online (Sandbox Code Playgroud) objective-c ×5
.net ×2
iphone ×2
xamarin.ios ×2
c# ×1
c++ ×1
cocoa ×1
cocoa-touch ×1
coding-style ×1
core-data ×1
dyld ×1
frameworks ×1
gcc ×1
ipad ×1
locking ×1
macos ×1
monodevelop ×1
pragma ×1
pthreads ×1
warnings ×1
xcode ×1