snej / MYUtilities

Objective-C Cocoa utility functions/methods I can't live without
Other
58 stars 21 forks source link

Make it compile with Xcode 5 (llvm 5.0) #4

Closed ristkof closed 11 years ago

ristkof commented 11 years ago

NSString is not an NSValue.

ristkof commented 11 years ago

Apple recommends using this NSValue class method (https://developer.apple.com/library/mac/documentation/cocoa/Conceptual/NumbersandValues/Articles/Values.html ). I'm not sure if the value doesn't need to be a *value, so you might want to double check.

snej commented 11 years ago

I don't have any trouble compiling with Xcode 5; what error were you getting?

_box doesn't return an NSValue, it returns id. The * case is explicitly supposed to return an NSString: it converts a C string to a Foundation one.

ristkof commented 11 years ago

I'm getting .../CollectionUtils.m:97:28: Incompatible pointer types returning 'NSString ' from a function with result type 'NSValue '

compiling with iOS SDK 6.1

compiler line:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7s -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Werror -Wno-missing-field-initializers -Wmissing-prototypes -Wno-implicit-atomic-properties -Wobjc-missing-property-synthesis -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -fobjc-abi-version=2 -miphoneos-version-min=5.0 -iquote /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/TouchDB-generated-files.hmap -I/Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/TouchDB-own-target-headers.hmap -I/Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/TouchDB-all-target-headers.hmap -iquote /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/TouchDB-project-headers.hmap -I/Users/kristof/Library/Developer/Xcode/DerivedData/Ideator-adlgfelqjbrhkcanonvaeymxbzef/Build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/DerivedSources/armv7s -I/Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/DerivedSources -Wall -Wformat-security -Wshorten-64-to-32 -Wmissing-declarations -F/Users/kristof/Library/Developer/Xcode/DerivedData/Ideator-adlgfelqjbrhkcanonvaeymxbzef/Build/Products/Debug-iphoneos -fno-objc-arc -include /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/Source/TouchDBPrefix.h -MMD -MT dependencies -MF /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/Objects-normal/armv7s/CollectionUtils.d --serialize-diagnostics /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/Objects-normal/armv7s/CollectionUtils.dia -c /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/vendor/MYUtilities/CollectionUtils.m -o /Users/kristof/Development/git/new-ideator/Ideator/TouchDB-iOS/build/TouchDB.build/Debug-iphoneos/iOS\ Library.build/Objects-normal/armv7s/CollectionUtils.o
snej commented 11 years ago

But the function doesn't return NSValue*. I don't know why you're getting that error. There did use to be such an error, but I fixed the return type of the function several months ago in commit f424a354c592. Are you sure you're not building with older sources than what's in your fork?

ristkof commented 11 years ago

My bad. Yes, I am. I am on 8bb82ba502610bddee119a41f0476d3ae91ef432, tag 1.02 ...

sorry!!