Objective-C: typedef NS_ENUM error
enums, ios, objective-c, typedef
Solution
You forgot to use curly brackets around the value definitions.
typedef NS_ENUM(NSInteger, MKIGridViewSelectionStyle) {
MKIGridViewSelectionStyle_SelectCellOnly = 1,
MKIGridViewSelectionStyle_SelectCompleteRow = 2,
MKIGridViewSelectionStyle_SelectCompleteColumn = 3
};
Problem
I'm using a typedef NS_ENUM in an iOS-App and I get this error: "linker command failed with exit code 1". Normally thats very easy to fix, but this time I can't find the solution... This is my NS_Enum: ``` typedef NS_ENUM(NSInteger, MKIGridViewSelectionStyle) MKIGridViewSelectionStyle_SelectCellOnly = 1, MKIGridViewSelectionStyle_SelectCompleteRow = 2, MKIGridViewSelectionStyle_SelectCompleteColumn = 3; ``` EDIT: The complete Message: Ld /Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Products/Debug-iphoneos/GridViewTest.app/GridViewTest normal armv7s cd /Users/mki/Desktop/GridViewTest setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Products/Debug-iphoneos -F/Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Products/Debug-iphoneos -filelist /Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Intermediates/GridViewTest.build/Debug-iphoneos/GridViewTest.build/Objects-normal/armv7s/GridViewTest.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=5.0 -framework QuartzCore -framework AudioToolbox -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Products/Debug-iphoneos/GridViewTest.app/GridViewTest duplicate symbol _MKIGridViewSelectionStyle_SelectCellOnly in: /Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Intermediates/GridViewTest.build/Debug-iphoneos/GridViewTest.build/Objects-normal/armv7s/MKIViewController.o /Users/mki/Library/Developer/Xcode/DerivedData/GridViewTest-esfqwoooiarqpchfzsazwbgckmso/Build/Intermediates/GridViewTest.build/Debug-iphoneos/GridViewTest.build/Objects-normal/armv7s/MKIGridView.o ld: 3 duplicate symbols for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation) Maik