From 24754c023aa9928b1e889e68ce0234b25e6eb640 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Jun 2015 13:57:55 -0700 Subject: [PATCH 1/7] Added Objective C HelloWorld example --- objective-c/HelloWorld/HelloWorld.podspec | 35 ++ .../HelloWorld.xcodeproj/project.pbxproj | 492 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../HelloWorld/HelloWorld/AppDelegate.h | 17 + .../HelloWorld/HelloWorld/AppDelegate.m | 45 ++ .../HelloWorld/Base.lproj/LaunchScreen.xib | 41 ++ .../HelloWorld/Base.lproj/Main.storyboard | 25 + .../AppIcon.appiconset/Contents.json | 68 +++ objective-c/HelloWorld/HelloWorld/Info.plist | 47 ++ .../HelloWorld/HelloWorld/ViewController.h | 15 + .../HelloWorld/HelloWorld/ViewController.m | 27 + objective-c/HelloWorld/HelloWorld/main.m | 26 + objective-c/HelloWorld/Podfile | 7 + 13 files changed, 852 insertions(+) create mode 100644 objective-c/HelloWorld/HelloWorld.podspec create mode 100644 objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj create mode 100644 objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 objective-c/HelloWorld/HelloWorld/AppDelegate.h create mode 100644 objective-c/HelloWorld/HelloWorld/AppDelegate.m create mode 100644 objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib create mode 100644 objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard create mode 100644 objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 objective-c/HelloWorld/HelloWorld/Info.plist create mode 100644 objective-c/HelloWorld/HelloWorld/ViewController.h create mode 100644 objective-c/HelloWorld/HelloWorld/ViewController.m create mode 100644 objective-c/HelloWorld/HelloWorld/main.m create mode 100644 objective-c/HelloWorld/Podfile diff --git a/objective-c/HelloWorld/HelloWorld.podspec b/objective-c/HelloWorld/HelloWorld.podspec new file mode 100644 index 0000000..744debb --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld.podspec @@ -0,0 +1,35 @@ +Pod::Spec.new do |s| + s.name = "HelloWorld" + s.version = "0.0.1" + s.license = "New BSD" + + s.ios.deployment_target = "6.0" + s.osx.deployment_target = "10.8" + + # Base directory where the .proto files are. + src = "../../protos" + + # Directory where the generated files will be place. + dir = "Pods/" + s.name + + # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. + s.prepare_command = <<-CMD + mkdir -p #{dir} + protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/helloworld.proto + CMD + + s.subspec "Messages" do |ms| + ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}" + ms.header_mappings_dir = dir + ms.requires_arc = false + ms.dependency "Protobuf", "~> 3.0.0-alpha-3" + end + + s.subspec "Services" do |ss| + ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}" + ss.header_mappings_dir = dir + ss.requires_arc = true + ss.dependency "gRPC", "~> 0.5" + ss.dependency "#{s.name}/Messages" + end +end diff --git a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6cc49ea --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj @@ -0,0 +1,492 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5E3690661B2A23800040F884 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3690651B2A23800040F884 /* main.m */; }; + 5E3690691B2A23800040F884 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3690681B2A23800040F884 /* AppDelegate.m */; }; + 5E36906C1B2A23800040F884 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E36906B1B2A23800040F884 /* ViewController.m */; }; + 5E36906F1B2A23800040F884 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E36906D1B2A23800040F884 /* Main.storyboard */; }; + 5E3690711B2A23800040F884 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E3690701B2A23800040F884 /* Images.xcassets */; }; + 5E3690741B2A23800040F884 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5E3690721B2A23800040F884 /* LaunchScreen.xib */; }; + 5E3690801B2A23800040F884 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E36907F1B2A23800040F884 /* HelloWorldTests.m */; }; + EF61CF6AE2536A31D47F0E63 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B4E1F55F8A2EC95A0E7EE88 /* libPods-HelloWorld.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5E36907A1B2A23800040F884 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5E3690581B2A23800040F884 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5E36905F1B2A23800040F884; + remoteInfo = HelloWorld; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; + 5E3690601B2A23800040F884 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5E3690641B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 5E3690671B2A23800040F884 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 5E3690681B2A23800040F884 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 5E36906A1B2A23800040F884 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 5E36906B1B2A23800040F884 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 5E36906E1B2A23800040F884 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 5E3690701B2A23800040F884 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 5E3690731B2A23800040F884 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 5E3690791B2A23800040F884 /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5E36907E1B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5E36907F1B2A23800040F884 /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = ""; }; + 6B4E1F55F8A2EC95A0E7EE88 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + DBDE3E48389499064CD664B8 /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5E36905D1B2A23800040F884 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + EF61CF6AE2536A31D47F0E63 /* libPods-HelloWorld.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5E3690761B2A23800040F884 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5E3690571B2A23800040F884 = { + isa = PBXGroup; + children = ( + 5E3690621B2A23800040F884 /* HelloWorld */, + 5E36907C1B2A23800040F884 /* HelloWorldTests */, + 5E3690611B2A23800040F884 /* Products */, + BD9CE6458E7C4FF49A1DF69F /* Pods */, + 66CEC7120220DDD2221DD075 /* Frameworks */, + ); + sourceTree = ""; + }; + 5E3690611B2A23800040F884 /* Products */ = { + isa = PBXGroup; + children = ( + 5E3690601B2A23800040F884 /* HelloWorld.app */, + 5E3690791B2A23800040F884 /* HelloWorldTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 5E3690621B2A23800040F884 /* HelloWorld */ = { + isa = PBXGroup; + children = ( + 5E3690671B2A23800040F884 /* AppDelegate.h */, + 5E3690681B2A23800040F884 /* AppDelegate.m */, + 5E36906A1B2A23800040F884 /* ViewController.h */, + 5E36906B1B2A23800040F884 /* ViewController.m */, + 5E36906D1B2A23800040F884 /* Main.storyboard */, + 5E3690701B2A23800040F884 /* Images.xcassets */, + 5E3690721B2A23800040F884 /* LaunchScreen.xib */, + 5E3690631B2A23800040F884 /* Supporting Files */, + ); + path = HelloWorld; + sourceTree = ""; + }; + 5E3690631B2A23800040F884 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5E3690641B2A23800040F884 /* Info.plist */, + 5E3690651B2A23800040F884 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5E36907C1B2A23800040F884 /* HelloWorldTests */ = { + isa = PBXGroup; + children = ( + 5E36907F1B2A23800040F884 /* HelloWorldTests.m */, + 5E36907D1B2A23800040F884 /* Supporting Files */, + ); + path = HelloWorldTests; + sourceTree = ""; + }; + 5E36907D1B2A23800040F884 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5E36907E1B2A23800040F884 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 66CEC7120220DDD2221DD075 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B4E1F55F8A2EC95A0E7EE88 /* libPods-HelloWorld.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + BD9CE6458E7C4FF49A1DF69F /* Pods */ = { + isa = PBXGroup; + children = ( + DBDE3E48389499064CD664B8 /* Pods-HelloWorld.debug.xcconfig */, + 0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5E36905F1B2A23800040F884 /* HelloWorld */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5E3690831B2A23810040F884 /* Build configuration list for PBXNativeTarget "HelloWorld" */; + buildPhases = ( + ACF9162361FB8F24C70657DE /* Check Pods Manifest.lock */, + 5E36905C1B2A23800040F884 /* Sources */, + 5E36905D1B2A23800040F884 /* Frameworks */, + 5E36905E1B2A23800040F884 /* Resources */, + 4C7D815378D98AB3BFC1A7D5 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HelloWorld; + productName = HelloWorld; + productReference = 5E3690601B2A23800040F884 /* HelloWorld.app */; + productType = "com.apple.product-type.application"; + }; + 5E3690781B2A23800040F884 /* HelloWorldTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5E3690861B2A23810040F884 /* Build configuration list for PBXNativeTarget "HelloWorldTests" */; + buildPhases = ( + 5E3690751B2A23800040F884 /* Sources */, + 5E3690761B2A23800040F884 /* Frameworks */, + 5E3690771B2A23800040F884 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5E36907B1B2A23800040F884 /* PBXTargetDependency */, + ); + name = HelloWorldTests; + productName = HelloWorldTests; + productReference = 5E3690791B2A23800040F884 /* HelloWorldTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5E3690581B2A23800040F884 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0620; + ORGANIZATIONNAME = Google; + TargetAttributes = { + 5E36905F1B2A23800040F884 = { + CreatedOnToolsVersion = 6.2; + }; + 5E3690781B2A23800040F884 = { + CreatedOnToolsVersion = 6.2; + TestTargetID = 5E36905F1B2A23800040F884; + }; + }; + }; + buildConfigurationList = 5E36905B1B2A23800040F884 /* Build configuration list for PBXProject "HelloWorld" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5E3690571B2A23800040F884; + productRefGroup = 5E3690611B2A23800040F884 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5E36905F1B2A23800040F884 /* HelloWorld */, + 5E3690781B2A23800040F884 /* HelloWorldTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5E36905E1B2A23800040F884 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5E36906F1B2A23800040F884 /* Main.storyboard in Resources */, + 5E3690741B2A23800040F884 /* LaunchScreen.xib in Resources */, + 5E3690711B2A23800040F884 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5E3690771B2A23800040F884 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 4C7D815378D98AB3BFC1A7D5 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + ACF9162361FB8F24C70657DE /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5E36905C1B2A23800040F884 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5E36906C1B2A23800040F884 /* ViewController.m in Sources */, + 5E3690691B2A23800040F884 /* AppDelegate.m in Sources */, + 5E3690661B2A23800040F884 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5E3690751B2A23800040F884 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5E3690801B2A23800040F884 /* HelloWorldTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5E36907B1B2A23800040F884 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5E36905F1B2A23800040F884 /* HelloWorld */; + targetProxy = 5E36907A1B2A23800040F884 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5E36906D1B2A23800040F884 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5E36906E1B2A23800040F884 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 5E3690721B2A23800040F884 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 5E3690731B2A23800040F884 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5E3690811B2A23810040F884 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 5E3690821B2A23810040F884 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5E3690841B2A23810040F884 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DBDE3E48389499064CD664B8 /* Pods-HelloWorld.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HelloWorld/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 5E3690851B2A23810040F884 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HelloWorld/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 5E3690871B2A23810040F884 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = HelloWorldTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; + }; + name = Debug; + }; + 5E3690881B2A23810040F884 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = HelloWorldTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5E36905B1B2A23800040F884 /* Build configuration list for PBXProject "HelloWorld" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E3690811B2A23810040F884 /* Debug */, + 5E3690821B2A23810040F884 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5E3690831B2A23810040F884 /* Build configuration list for PBXNativeTarget "HelloWorld" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E3690841B2A23810040F884 /* Debug */, + 5E3690851B2A23810040F884 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5E3690861B2A23810040F884 /* Build configuration list for PBXNativeTarget "HelloWorldTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E3690871B2A23810040F884 /* Debug */, + 5E3690881B2A23810040F884 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5E3690581B2A23800040F884 /* Project object */; +} diff --git a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..174a04e --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.h b/objective-c/HelloWorld/HelloWorld/AppDelegate.h new file mode 100644 index 0000000..b1eaba9 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// HelloWorld +// +// Created by Michael Lumish on 6/11/15. +// Copyright (c) 2015 Google. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.m b/objective-c/HelloWorld/HelloWorld/AppDelegate.m new file mode 100644 index 0000000..cd6498d --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// HelloWorld +// +// Created by Michael Lumish on 6/11/15. +// Copyright (c) 2015 Google. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib b/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..8fcc4fd --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard b/objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f56d2f3 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json b/objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/objective-c/HelloWorld/HelloWorld/Info.plist b/objective-c/HelloWorld/HelloWorld/Info.plist new file mode 100644 index 0000000..77352c9 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + Google.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.h b/objective-c/HelloWorld/HelloWorld/ViewController.h new file mode 100644 index 0000000..c822a66 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// HelloWorld +// +// Created by Michael Lumish on 6/11/15. +// Copyright (c) 2015 Google. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.m b/objective-c/HelloWorld/HelloWorld/ViewController.m new file mode 100644 index 0000000..5aa4441 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// HelloWorld +// +// Created by Michael Lumish on 6/11/15. +// Copyright (c) 2015 Google. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/objective-c/HelloWorld/HelloWorld/main.m b/objective-c/HelloWorld/HelloWorld/main.m new file mode 100644 index 0000000..c912b63 --- /dev/null +++ b/objective-c/HelloWorld/HelloWorld/main.m @@ -0,0 +1,26 @@ +// +// main.m +// HelloWorld +// +// Created by Michael Lumish on 6/11/15. +// Copyright (c) 2015 Google. All rights reserved. +// + +#import +#import "AppDelegate.h" + +#import + +static NSString * const kHostAddress = @"http://localhost:50051"; + +int main(int argc, char * argv[]) { + @autoreleasepool { + HLWGreeter *client = [[HLWGreeter alloc] initWithHost:kHostAddress]; + HLWHelloRequest *request = [HLWHelloRequest message]; + request.name = @"Objective C"; + [client sayHelloWithRequest:request handler:^(HLWHelloReply *response, NSError *error) { + NSLog(@"%@", response.message); + }]; + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/objective-c/HelloWorld/Podfile b/objective-c/HelloWorld/Podfile new file mode 100644 index 0000000..2934ebc --- /dev/null +++ b/objective-c/HelloWorld/Podfile @@ -0,0 +1,7 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' + +target 'HelloWorld' do + # Depend on the generated HelloWorld library. + pod 'HelloWorld', :path => '.' +end From 042b91253eeeca0f7da38d0c881a0072506f9289 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Jun 2015 14:23:32 -0700 Subject: [PATCH 2/7] Added Objective C HelloWorld README --- objective-c/HelloWorld/README.md | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 objective-c/HelloWorld/README.md diff --git a/objective-c/HelloWorld/README.md b/objective-c/HelloWorld/README.md new file mode 100644 index 0000000..db3bcb1 --- /dev/null +++ b/objective-c/HelloWorld/README.md @@ -0,0 +1,48 @@ +#gRPC in 3 minutes (Objective C) + +## Installation + +To run this example you should have [Cocoapods](https://cocoapods.org/#install) installed, as well as the relevant tools to generate the client library code (and a server in another language, for testing). You can obtain the latter by following [these setup instructions](https://github.com/grpc/homebrew-grpc). + +## Hello Objective C gRPC! + +Here's how to build and run the Objective C implementation of the [Hello World](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc-common). + +The example code for this and our other examples lives in the `grpc-common` +GitHub repository. Clone this repository to your local machine by running the +following command: + + +```sh +$ git clone https://github.com/grpc/grpc-common.git +``` + +Change your current directory to grpc-common/objective-c/HelloWorld + +```sh +$ cd grpc-common/objective-c/HelloWorld +``` + +### Try it! +To try the sample app, we need a gRPC server running locally. Let's compile and run, for example, the C++ server in this repository: + +```shell +$ pushd ../../cpp/helloworld +$ make +$ ./greeter_server & +$ popd +``` + +Now have Cocoapods generate and install the client library for our .proto files: + +```shell +$ pod install +``` + +This might have to compile OpenSSL, which takes around 15 minutes if Cocoapods doesn't have it yet on your computer's cache). + +Finally, open the XCode workspace created by Cocoapods, and run the app. You can check the calling code in `Supporting Files/main.m` and see the results in XCode's log console. + +## Tutorial + +You can find a more detailed tutorial in [gRPC Basics: Objective C](https://github.com/grpc/grpc-common/blob/master/objective-c/route_guide/README.md) \ No newline at end of file From 5de22f5146abf273f1d54aeeb29c02e651d63b7b Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Jun 2015 11:21:55 -0700 Subject: [PATCH 3/7] Removed what I could, fixed some nits --- .../HelloWorld.xcodeproj/project.pbxproj | 12 ---- .../HelloWorld/HelloWorld/AppDelegate.h | 40 ++++++++--- .../HelloWorld/HelloWorld/AppDelegate.m | 71 +++++++++---------- .../HelloWorld/Base.lproj/LaunchScreen.xib | 41 ----------- objective-c/HelloWorld/HelloWorld/Info.plist | 2 +- .../HelloWorld/HelloWorld/ViewController.h | 39 ++++++++-- .../HelloWorld/HelloWorld/ViewController.m | 53 ++++++++------ objective-c/HelloWorld/HelloWorld/main.m | 41 ++++++++--- objective-c/HelloWorld/README.md | 12 ++-- 9 files changed, 169 insertions(+), 142 deletions(-) delete mode 100644 objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib diff --git a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj index 6cc49ea..9a7b305 100644 --- a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj +++ b/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 5E36906C1B2A23800040F884 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E36906B1B2A23800040F884 /* ViewController.m */; }; 5E36906F1B2A23800040F884 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E36906D1B2A23800040F884 /* Main.storyboard */; }; 5E3690711B2A23800040F884 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E3690701B2A23800040F884 /* Images.xcassets */; }; - 5E3690741B2A23800040F884 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5E3690721B2A23800040F884 /* LaunchScreen.xib */; }; 5E3690801B2A23800040F884 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E36907F1B2A23800040F884 /* HelloWorldTests.m */; }; EF61CF6AE2536A31D47F0E63 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B4E1F55F8A2EC95A0E7EE88 /* libPods-HelloWorld.a */; }; /* End PBXBuildFile section */ @@ -38,7 +37,6 @@ 5E36906B1B2A23800040F884 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 5E36906E1B2A23800040F884 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 5E3690701B2A23800040F884 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 5E3690731B2A23800040F884 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 5E3690791B2A23800040F884 /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5E36907E1B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5E36907F1B2A23800040F884 /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = ""; }; @@ -94,7 +92,6 @@ 5E36906B1B2A23800040F884 /* ViewController.m */, 5E36906D1B2A23800040F884 /* Main.storyboard */, 5E3690701B2A23800040F884 /* Images.xcassets */, - 5E3690721B2A23800040F884 /* LaunchScreen.xib */, 5E3690631B2A23800040F884 /* Supporting Files */, ); path = HelloWorld; @@ -226,7 +223,6 @@ buildActionMask = 2147483647; files = ( 5E36906F1B2A23800040F884 /* Main.storyboard in Resources */, - 5E3690741B2A23800040F884 /* LaunchScreen.xib in Resources */, 5E3690711B2A23800040F884 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -311,14 +307,6 @@ name = Main.storyboard; sourceTree = ""; }; - 5E3690721B2A23800040F884 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 5E3690731B2A23800040F884 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.h b/objective-c/HelloWorld/HelloWorld/AppDelegate.h index b1eaba9..b1857f2 100644 --- a/objective-c/HelloWorld/HelloWorld/AppDelegate.h +++ b/objective-c/HelloWorld/HelloWorld/AppDelegate.h @@ -1,10 +1,35 @@ -// -// AppDelegate.h -// HelloWorld -// -// Created by Michael Lumish on 6/11/15. -// Copyright (c) 2015 Google. All rights reserved. -// +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #import @@ -12,6 +37,5 @@ @property (strong, nonatomic) UIWindow *window; - @end diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.m b/objective-c/HelloWorld/HelloWorld/AppDelegate.m index cd6498d..27b1f00 100644 --- a/objective-c/HelloWorld/HelloWorld/AppDelegate.m +++ b/objective-c/HelloWorld/HelloWorld/AppDelegate.m @@ -1,45 +1,38 @@ -// -// AppDelegate.m -// HelloWorld -// -// Created by Michael Lumish on 6/11/15. -// Copyright (c) 2015 Google. All rights reserved. -// +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #import "AppDelegate.h" -@interface AppDelegate () - -@end - @implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - @end diff --git a/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib b/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 8fcc4fd..0000000 --- a/objective-c/HelloWorld/HelloWorld/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/objective-c/HelloWorld/HelloWorld/Info.plist b/objective-c/HelloWorld/HelloWorld/Info.plist index 77352c9..1078fff 100644 --- a/objective-c/HelloWorld/HelloWorld/Info.plist +++ b/objective-c/HelloWorld/HelloWorld/Info.plist @@ -23,7 +23,7 @@ LSRequiresIPhoneOS UILaunchStoryboardName - LaunchScreen + Main UIMainStoryboardFile Main UIRequiredDeviceCapabilities diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.h b/objective-c/HelloWorld/HelloWorld/ViewController.h index c822a66..38cd7f9 100644 --- a/objective-c/HelloWorld/HelloWorld/ViewController.h +++ b/objective-c/HelloWorld/HelloWorld/ViewController.h @@ -1,10 +1,35 @@ -// -// ViewController.h -// HelloWorld -// -// Created by Michael Lumish on 6/11/15. -// Copyright (c) 2015 Google. All rights reserved. -// +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #import diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.m b/objective-c/HelloWorld/HelloWorld/ViewController.m index 5aa4441..91df435 100644 --- a/objective-c/HelloWorld/HelloWorld/ViewController.m +++ b/objective-c/HelloWorld/HelloWorld/ViewController.m @@ -1,27 +1,38 @@ -// -// ViewController.m -// HelloWorld -// -// Created by Michael Lumish on 6/11/15. -// Copyright (c) 2015 Google. All rights reserved. -// +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #import "ViewController.h" -@interface ViewController () - -@end - @implementation ViewController -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - @end diff --git a/objective-c/HelloWorld/HelloWorld/main.m b/objective-c/HelloWorld/HelloWorld/main.m index c912b63..458580b 100644 --- a/objective-c/HelloWorld/HelloWorld/main.m +++ b/objective-c/HelloWorld/HelloWorld/main.m @@ -1,10 +1,35 @@ -// -// main.m -// HelloWorld -// -// Created by Michael Lumish on 6/11/15. -// Copyright (c) 2015 Google. All rights reserved. -// +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #import #import "AppDelegate.h" @@ -17,7 +42,7 @@ int main(int argc, char * argv[]) { @autoreleasepool { HLWGreeter *client = [[HLWGreeter alloc] initWithHost:kHostAddress]; HLWHelloRequest *request = [HLWHelloRequest message]; - request.name = @"Objective C"; + request.name = @"Objective-C"; [client sayHelloWithRequest:request handler:^(HLWHelloReply *response, NSError *error) { NSLog(@"%@", response.message); }]; diff --git a/objective-c/HelloWorld/README.md b/objective-c/HelloWorld/README.md index db3bcb1..cb25882 100644 --- a/objective-c/HelloWorld/README.md +++ b/objective-c/HelloWorld/README.md @@ -1,12 +1,12 @@ -#gRPC in 3 minutes (Objective C) +#gRPC in 3 minutes (Objective-C) ## Installation To run this example you should have [Cocoapods](https://cocoapods.org/#install) installed, as well as the relevant tools to generate the client library code (and a server in another language, for testing). You can obtain the latter by following [these setup instructions](https://github.com/grpc/homebrew-grpc). -## Hello Objective C gRPC! +## Hello Objective-C gRPC! -Here's how to build and run the Objective C implementation of the [Hello World](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc-common). +Here's how to build and run the Objective-C implementation of the [Hello World](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc-common). The example code for this and our other examples lives in the `grpc-common` GitHub repository. Clone this repository to your local machine by running the @@ -17,7 +17,7 @@ following command: $ git clone https://github.com/grpc/grpc-common.git ``` -Change your current directory to grpc-common/objective-c/HelloWorld +Change your current directory to `grpc-common/objective-c/HelloWorld` ```sh $ cd grpc-common/objective-c/HelloWorld @@ -43,6 +43,8 @@ This might have to compile OpenSSL, which takes around 15 minutes if Cocoapods d Finally, open the XCode workspace created by Cocoapods, and run the app. You can check the calling code in `Supporting Files/main.m` and see the results in XCode's log console. +The code sends a `HLWHelloRequest` containing the string "Objective-C" to a local server. The server responds with a `HLWHelloResponse`, which contains a string that is then output to the log. + ## Tutorial -You can find a more detailed tutorial in [gRPC Basics: Objective C](https://github.com/grpc/grpc-common/blob/master/objective-c/route_guide/README.md) \ No newline at end of file +You can find a more detailed tutorial in [gRPC Basics: Objective-C](https://github.com/grpc/grpc-common/blob/master/objective-c/route_guide/README.md) \ No newline at end of file From b92da5f8fb419871042d498d47dab09083f8a6b7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Jun 2015 11:24:08 -0700 Subject: [PATCH 4/7] Renamed HelloWorld to helloworld --- objective-c/{HelloWorld => helloworld}/HelloWorld.podspec | 0 .../HelloWorld.xcodeproj/project.pbxproj | 0 .../project.xcworkspace/contents.xcworkspacedata | 0 objective-c/{HelloWorld => helloworld}/HelloWorld/AppDelegate.h | 0 objective-c/{HelloWorld => helloworld}/HelloWorld/AppDelegate.m | 0 .../HelloWorld/Base.lproj/Main.storyboard | 0 .../HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json | 0 objective-c/{HelloWorld => helloworld}/HelloWorld/Info.plist | 0 .../{HelloWorld => helloworld}/HelloWorld/ViewController.h | 0 .../{HelloWorld => helloworld}/HelloWorld/ViewController.m | 0 objective-c/{HelloWorld => helloworld}/HelloWorld/main.m | 0 objective-c/{HelloWorld => helloworld}/Podfile | 0 objective-c/{HelloWorld => helloworld}/README.md | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename objective-c/{HelloWorld => helloworld}/HelloWorld.podspec (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld.xcodeproj/project.pbxproj (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/AppDelegate.h (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/AppDelegate.m (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/Base.lproj/Main.storyboard (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/Info.plist (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/ViewController.h (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/ViewController.m (100%) rename objective-c/{HelloWorld => helloworld}/HelloWorld/main.m (100%) rename objective-c/{HelloWorld => helloworld}/Podfile (100%) rename objective-c/{HelloWorld => helloworld}/README.md (100%) diff --git a/objective-c/HelloWorld/HelloWorld.podspec b/objective-c/helloworld/HelloWorld.podspec similarity index 100% rename from objective-c/HelloWorld/HelloWorld.podspec rename to objective-c/helloworld/HelloWorld.podspec diff --git a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj b/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj similarity index 100% rename from objective-c/HelloWorld/HelloWorld.xcodeproj/project.pbxproj rename to objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj diff --git a/objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/objective-c/helloworld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from objective-c/HelloWorld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to objective-c/helloworld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.h b/objective-c/helloworld/HelloWorld/AppDelegate.h similarity index 100% rename from objective-c/HelloWorld/HelloWorld/AppDelegate.h rename to objective-c/helloworld/HelloWorld/AppDelegate.h diff --git a/objective-c/HelloWorld/HelloWorld/AppDelegate.m b/objective-c/helloworld/HelloWorld/AppDelegate.m similarity index 100% rename from objective-c/HelloWorld/HelloWorld/AppDelegate.m rename to objective-c/helloworld/HelloWorld/AppDelegate.m diff --git a/objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard b/objective-c/helloworld/HelloWorld/Base.lproj/Main.storyboard similarity index 100% rename from objective-c/HelloWorld/HelloWorld/Base.lproj/Main.storyboard rename to objective-c/helloworld/HelloWorld/Base.lproj/Main.storyboard diff --git a/objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json b/objective-c/helloworld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from objective-c/HelloWorld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json rename to objective-c/helloworld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/objective-c/HelloWorld/HelloWorld/Info.plist b/objective-c/helloworld/HelloWorld/Info.plist similarity index 100% rename from objective-c/HelloWorld/HelloWorld/Info.plist rename to objective-c/helloworld/HelloWorld/Info.plist diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.h b/objective-c/helloworld/HelloWorld/ViewController.h similarity index 100% rename from objective-c/HelloWorld/HelloWorld/ViewController.h rename to objective-c/helloworld/HelloWorld/ViewController.h diff --git a/objective-c/HelloWorld/HelloWorld/ViewController.m b/objective-c/helloworld/HelloWorld/ViewController.m similarity index 100% rename from objective-c/HelloWorld/HelloWorld/ViewController.m rename to objective-c/helloworld/HelloWorld/ViewController.m diff --git a/objective-c/HelloWorld/HelloWorld/main.m b/objective-c/helloworld/HelloWorld/main.m similarity index 100% rename from objective-c/HelloWorld/HelloWorld/main.m rename to objective-c/helloworld/HelloWorld/main.m diff --git a/objective-c/HelloWorld/Podfile b/objective-c/helloworld/Podfile similarity index 100% rename from objective-c/HelloWorld/Podfile rename to objective-c/helloworld/Podfile diff --git a/objective-c/HelloWorld/README.md b/objective-c/helloworld/README.md similarity index 100% rename from objective-c/HelloWorld/README.md rename to objective-c/helloworld/README.md From b056066235453b55c7678374c85dde373d03f86f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Jun 2015 12:37:08 -0700 Subject: [PATCH 5/7] Moved file within project --- .../HelloWorld.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj b/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj index 9a7b305..018e722 100644 --- a/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj +++ b/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ 0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; 5E3690601B2A23800040F884 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5E3690641B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; 5E3690671B2A23800040F884 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 5E3690681B2A23800040F884 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 5E36906A1B2A23800040F884 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; @@ -66,6 +66,7 @@ 5E3690571B2A23800040F884 = { isa = PBXGroup; children = ( + 5E3690651B2A23800040F884 /* main.m */, 5E3690621B2A23800040F884 /* HelloWorld */, 5E36907C1B2A23800040F884 /* HelloWorldTests */, 5E3690611B2A23800040F884 /* Products */, @@ -86,12 +87,6 @@ 5E3690621B2A23800040F884 /* HelloWorld */ = { isa = PBXGroup; children = ( - 5E3690671B2A23800040F884 /* AppDelegate.h */, - 5E3690681B2A23800040F884 /* AppDelegate.m */, - 5E36906A1B2A23800040F884 /* ViewController.h */, - 5E36906B1B2A23800040F884 /* ViewController.m */, - 5E36906D1B2A23800040F884 /* Main.storyboard */, - 5E3690701B2A23800040F884 /* Images.xcassets */, 5E3690631B2A23800040F884 /* Supporting Files */, ); path = HelloWorld; @@ -100,8 +95,13 @@ 5E3690631B2A23800040F884 /* Supporting Files */ = { isa = PBXGroup; children = ( + 5E3690701B2A23800040F884 /* Images.xcassets */, + 5E36906D1B2A23800040F884 /* Main.storyboard */, + 5E36906B1B2A23800040F884 /* ViewController.m */, + 5E36906A1B2A23800040F884 /* ViewController.h */, + 5E3690681B2A23800040F884 /* AppDelegate.m */, + 5E3690671B2A23800040F884 /* AppDelegate.h */, 5E3690641B2A23800040F884 /* Info.plist */, - 5E3690651B2A23800040F884 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; From 3ea5cc927c733b8e8bba9f8bbce1f2ac8634ceb9 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Jun 2015 16:06:37 -0700 Subject: [PATCH 6/7] Fixed path names in README --- objective-c/helloworld/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/objective-c/helloworld/README.md b/objective-c/helloworld/README.md index cb25882..8f6d0d3 100644 --- a/objective-c/helloworld/README.md +++ b/objective-c/helloworld/README.md @@ -17,10 +17,10 @@ following command: $ git clone https://github.com/grpc/grpc-common.git ``` -Change your current directory to `grpc-common/objective-c/HelloWorld` +Change your current directory to `grpc-common/objective-c/helloworld` ```sh -$ cd grpc-common/objective-c/HelloWorld +$ cd grpc-common/objective-c/helloworld ``` ### Try it! @@ -41,7 +41,7 @@ $ pod install This might have to compile OpenSSL, which takes around 15 minutes if Cocoapods doesn't have it yet on your computer's cache). -Finally, open the XCode workspace created by Cocoapods, and run the app. You can check the calling code in `Supporting Files/main.m` and see the results in XCode's log console. +Finally, open the XCode workspace created by Cocoapods, and run the app. You can check the calling code in `main.m` and see the results in XCode's log console. The code sends a `HLWHelloRequest` containing the string "Objective-C" to a local server. The server responds with a `HLWHelloResponse`, which contains a string that is then output to the log. From a0117adab0f764f499e839eea922e070418c6f14 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Jun 2015 16:08:18 -0700 Subject: [PATCH 7/7] Moved main.m up a level --- objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj | 2 +- objective-c/helloworld/{HelloWorld => }/main.m | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename objective-c/helloworld/{HelloWorld => }/main.m (100%) diff --git a/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj b/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj index 018e722..8d92247 100644 --- a/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj +++ b/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ 0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; 5E3690601B2A23800040F884 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5E3690641B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; + 5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 5E3690671B2A23800040F884 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 5E3690681B2A23800040F884 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 5E36906A1B2A23800040F884 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; diff --git a/objective-c/helloworld/HelloWorld/main.m b/objective-c/helloworld/main.m similarity index 100% rename from objective-c/helloworld/HelloWorld/main.m rename to objective-c/helloworld/main.m