From 000012b5b2ea25ea9211fd630a52850a76a1a0a8 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 20 Nov 2013 13:29:28 -0500 Subject: Add iOS equivalent of CocoaApplication example. Change-Id: I4f1ad74617d3326001d49e67e1de7e308ab12eff Reviewed-by: Joerg Bornemann --- .../CocoaTouchApplication.qbs | 81 +++++ .../project.pbxproj | 347 +++++++++++++++++++++ .../CocoaTouchApplication/AppDelegate.h | 45 +++ .../CocoaTouchApplication/AppDelegate.m | 104 ++++++ .../CocoaTouchApplication-Info.plist | 55 ++++ .../CocoaTouchApplication-Prefix.pch | 39 +++ .../CocoaTouchApplication/Default-568h@2x.png | Bin 0 -> 18594 bytes .../CocoaTouchApplication/Default.png | Bin 0 -> 6540 bytes .../CocoaTouchApplication/Default@2x.png | Bin 0 -> 16107 bytes .../CocoaTouchApplication/DetailViewController.h | 43 +++ .../CocoaTouchApplication/DetailViewController.m | 115 +++++++ .../CocoaTouchApplication/MasterViewController.h | 42 +++ .../CocoaTouchApplication/MasterViewController.m | 161 ++++++++++ .../en.lproj/DetailViewController_iPad.xib | 223 +++++++++++++ .../en.lproj/DetailViewController_iPhone.xib | 253 +++++++++++++++ .../en.lproj/InfoPlist.strings | 1 + .../en.lproj/MasterViewController_iPad.xib | 152 +++++++++ .../en.lproj/MasterViewController_iPhone.xib | 147 +++++++++ .../CocoaTouchApplication/main.m | 39 +++ 19 files changed, 1847 insertions(+) create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication.qbs create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.h create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Prefix.pch create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/Default.png create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.h create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.h create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPad.xib create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPhone.xib create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/InfoPlist.strings create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPad.xib create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPhone.xib create mode 100644 examples/cocoa-touch-application/CocoaTouchApplication/main.m (limited to 'examples/cocoa-touch-application') diff --git a/examples/cocoa-touch-application/CocoaTouchApplication.qbs b/examples/cocoa-touch-application/CocoaTouchApplication.qbs new file mode 100644 index 000000000..66ca558fc --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication.qbs @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Build Suite. +** +** You may use this file under the terms of the BSD license as follows: +** +** "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 Digia Plc and its Subsidiary(-ies) 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 qbs 1.0 + +CppApplication { + Depends { condition: product.condition; name: "ib" } + condition: qbs.targetOS.contains("ios") + type: "applicationbundle" + name: "CocoaTouchApplication" + + cpp.precompiledHeader: "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch" + + cpp.infoPlistFile: "CocoaTouchApplication/CocoaTouchApplication-Info.plist" + + cpp.frameworks: [ "UIKit", "Foundation", "CoreGraphics" ] + + Group { + prefix: "CocoaTouchApplication/" + files: [ + "AppDelegate.h", + "AppDelegate.m", + "CocoaTouchApplication-Prefix.pch", + "Default-568h@2x.png", + "Default.png", + "Default@2x.png", + "DetailViewController.h", + "DetailViewController.m", + "MasterViewController.h", + "MasterViewController.m", + "main.m" + ] + } + + Group { + name: "Supporting Files" + prefix: "CocoaTouchApplication/en.lproj/" + files: [ + "DetailViewController_iPad.xib", + "DetailViewController_iPhone.xib", + "InfoPlist.strings", + "MasterViewController_iPad.xib", + "MasterViewController_iPhone.xib" + ] + } +} diff --git a/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj b/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj new file mode 100644 index 000000000..56dc757a8 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj @@ -0,0 +1,347 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 14E3FEAA175FB2E800C857C6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14E3FEA9175FB2E800C857C6 /* UIKit.framework */; }; + 14E3FEAC175FB2E800C857C6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14E3FEAB175FB2E800C857C6 /* Foundation.framework */; }; + 14E3FEAE175FB2E800C857C6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14E3FEAD175FB2E800C857C6 /* CoreGraphics.framework */; }; + 14E3FEB4175FB2E800C857C6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEB2175FB2E800C857C6 /* InfoPlist.strings */; }; + 14E3FEB6175FB2E800C857C6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEB5175FB2E800C857C6 /* main.m */; }; + 14E3FEBA175FB2E800C857C6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEB9175FB2E800C857C6 /* AppDelegate.m */; }; + 14E3FEBC175FB2E800C857C6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBB175FB2E800C857C6 /* Default.png */; }; + 14E3FEBE175FB2E800C857C6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBD175FB2E800C857C6 /* Default@2x.png */; }; + 14E3FEC0175FB2E800C857C6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */; }; + 14E3FEC3175FB2E800C857C6 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEC2175FB2E800C857C6 /* MasterViewController.m */; }; + 14E3FEC6175FB2E900C857C6 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEC5175FB2E900C857C6 /* DetailViewController.m */; }; + 14E3FEC9175FB2E900C857C6 /* MasterViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEC7175FB2E900C857C6 /* MasterViewController_iPhone.xib */; }; + 14E3FECC175FB2E900C857C6 /* MasterViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FECA175FB2E900C857C6 /* MasterViewController_iPad.xib */; }; + 14E3FECF175FB2E900C857C6 /* DetailViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FECD175FB2E900C857C6 /* DetailViewController_iPhone.xib */; }; + 14E3FED2175FB2E900C857C6 /* DetailViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FED0175FB2E900C857C6 /* DetailViewController_iPad.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 14E3FEA6175FB2E800C857C6 /* CocoaTouchApplication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaTouchApplication.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 14E3FEA9175FB2E800C857C6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 14E3FEAB175FB2E800C857C6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 14E3FEAD175FB2E800C857C6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 14E3FEB1175FB2E800C857C6 /* CocoaTouchApplication-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaTouchApplication-Info.plist"; sourceTree = ""; }; + 14E3FEB3175FB2E800C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 14E3FEB5175FB2E800C857C6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 14E3FEB7175FB2E800C857C6 /* CocoaTouchApplication-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocoaTouchApplication-Prefix.pch"; sourceTree = ""; }; + 14E3FEB8175FB2E800C857C6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 14E3FEB9175FB2E800C857C6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 14E3FEBB175FB2E800C857C6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + 14E3FEBD175FB2E800C857C6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 14E3FEC1175FB2E800C857C6 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; + 14E3FEC2175FB2E800C857C6 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; + 14E3FEC4175FB2E800C857C6 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; + 14E3FEC5175FB2E900C857C6 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; + 14E3FEC8175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MasterViewController_iPhone.xib; sourceTree = ""; }; + 14E3FECB175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MasterViewController_iPad.xib; sourceTree = ""; }; + 14E3FECE175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController_iPhone.xib; sourceTree = ""; }; + 14E3FED1175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController_iPad.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 14E3FEA3175FB2E800C857C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 14E3FEAA175FB2E800C857C6 /* UIKit.framework in Frameworks */, + 14E3FEAC175FB2E800C857C6 /* Foundation.framework in Frameworks */, + 14E3FEAE175FB2E800C857C6 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 14E3FE9D175FB2E800C857C6 = { + isa = PBXGroup; + children = ( + 14E3FEAF175FB2E800C857C6 /* CocoaTouchApplication */, + 14E3FEA8175FB2E800C857C6 /* Frameworks */, + 14E3FEA7175FB2E800C857C6 /* Products */, + ); + sourceTree = ""; + }; + 14E3FEA7175FB2E800C857C6 /* Products */ = { + isa = PBXGroup; + children = ( + 14E3FEA6175FB2E800C857C6 /* CocoaTouchApplication.app */, + ); + name = Products; + sourceTree = ""; + }; + 14E3FEA8175FB2E800C857C6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 14E3FEA9175FB2E800C857C6 /* UIKit.framework */, + 14E3FEAB175FB2E800C857C6 /* Foundation.framework */, + 14E3FEAD175FB2E800C857C6 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 14E3FEAF175FB2E800C857C6 /* CocoaTouchApplication */ = { + isa = PBXGroup; + children = ( + 14E3FEB8175FB2E800C857C6 /* AppDelegate.h */, + 14E3FEB9175FB2E800C857C6 /* AppDelegate.m */, + 14E3FEC1175FB2E800C857C6 /* MasterViewController.h */, + 14E3FEC2175FB2E800C857C6 /* MasterViewController.m */, + 14E3FEC4175FB2E800C857C6 /* DetailViewController.h */, + 14E3FEC5175FB2E900C857C6 /* DetailViewController.m */, + 14E3FEC7175FB2E900C857C6 /* MasterViewController_iPhone.xib */, + 14E3FECA175FB2E900C857C6 /* MasterViewController_iPad.xib */, + 14E3FECD175FB2E900C857C6 /* DetailViewController_iPhone.xib */, + 14E3FED0175FB2E900C857C6 /* DetailViewController_iPad.xib */, + 14E3FEB0175FB2E800C857C6 /* Supporting Files */, + ); + path = CocoaTouchApplication; + sourceTree = ""; + }; + 14E3FEB0175FB2E800C857C6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 14E3FEB1175FB2E800C857C6 /* CocoaTouchApplication-Info.plist */, + 14E3FEB2175FB2E800C857C6 /* InfoPlist.strings */, + 14E3FEB5175FB2E800C857C6 /* main.m */, + 14E3FEB7175FB2E800C857C6 /* CocoaTouchApplication-Prefix.pch */, + 14E3FEBB175FB2E800C857C6 /* Default.png */, + 14E3FEBD175FB2E800C857C6 /* Default@2x.png */, + 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 14E3FEA5175FB2E800C857C6 /* CocoaTouchApplication */ = { + isa = PBXNativeTarget; + buildConfigurationList = 14E3FED5175FB2E900C857C6 /* Build configuration list for PBXNativeTarget "CocoaTouchApplication" */; + buildPhases = ( + 14E3FEA2175FB2E800C857C6 /* Sources */, + 14E3FEA3175FB2E800C857C6 /* Frameworks */, + 14E3FEA4175FB2E800C857C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CocoaTouchApplication; + productName = CocoaTouchApplication; + productReference = 14E3FEA6175FB2E800C857C6 /* CocoaTouchApplication.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 14E3FE9E175FB2E800C857C6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Petroules Corporation"; + }; + buildConfigurationList = 14E3FEA1175FB2E800C857C6 /* Build configuration list for PBXProject "CocoaTouchApplication" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 14E3FE9D175FB2E800C857C6; + productRefGroup = 14E3FEA7175FB2E800C857C6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 14E3FEA5175FB2E800C857C6 /* CocoaTouchApplication */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 14E3FEA4175FB2E800C857C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 14E3FEB4175FB2E800C857C6 /* InfoPlist.strings in Resources */, + 14E3FEBC175FB2E800C857C6 /* Default.png in Resources */, + 14E3FEBE175FB2E800C857C6 /* Default@2x.png in Resources */, + 14E3FEC0175FB2E800C857C6 /* Default-568h@2x.png in Resources */, + 14E3FEC9175FB2E900C857C6 /* MasterViewController_iPhone.xib in Resources */, + 14E3FECC175FB2E900C857C6 /* MasterViewController_iPad.xib in Resources */, + 14E3FECF175FB2E900C857C6 /* DetailViewController_iPhone.xib in Resources */, + 14E3FED2175FB2E900C857C6 /* DetailViewController_iPad.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 14E3FEA2175FB2E800C857C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 14E3FEB6175FB2E800C857C6 /* main.m in Sources */, + 14E3FEBA175FB2E800C857C6 /* AppDelegate.m in Sources */, + 14E3FEC3175FB2E800C857C6 /* MasterViewController.m in Sources */, + 14E3FEC6175FB2E900C857C6 /* DetailViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 14E3FEB2175FB2E800C857C6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 14E3FEB3175FB2E800C857C6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 14E3FEC7175FB2E900C857C6 /* MasterViewController_iPhone.xib */ = { + isa = PBXVariantGroup; + children = ( + 14E3FEC8175FB2E900C857C6 /* en */, + ); + name = MasterViewController_iPhone.xib; + sourceTree = ""; + }; + 14E3FECA175FB2E900C857C6 /* MasterViewController_iPad.xib */ = { + isa = PBXVariantGroup; + children = ( + 14E3FECB175FB2E900C857C6 /* en */, + ); + name = MasterViewController_iPad.xib; + sourceTree = ""; + }; + 14E3FECD175FB2E900C857C6 /* DetailViewController_iPhone.xib */ = { + isa = PBXVariantGroup; + children = ( + 14E3FECE175FB2E900C857C6 /* en */, + ); + name = DetailViewController_iPhone.xib; + sourceTree = ""; + }; + 14E3FED0175FB2E900C857C6 /* DetailViewController_iPad.xib */ = { + isa = PBXVariantGroup; + children = ( + 14E3FED1175FB2E900C857C6 /* en */, + ); + name = DetailViewController_iPad.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 14E3FED3175FB2E900C857C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + 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_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 14E3FED4175FB2E900C857C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 14E3FED6175FB2E900C857C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch"; + INFOPLIST_FILE = "CocoaTouchApplication/CocoaTouchApplication-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 14E3FED7175FB2E900C857C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch"; + INFOPLIST_FILE = "CocoaTouchApplication/CocoaTouchApplication-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 14E3FEA1175FB2E800C857C6 /* Build configuration list for PBXProject "CocoaTouchApplication" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 14E3FED3175FB2E900C857C6 /* Debug */, + 14E3FED4175FB2E900C857C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 14E3FED5175FB2E900C857C6 /* Build configuration list for PBXNativeTarget "CocoaTouchApplication" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 14E3FED6175FB2E900C857C6 /* Debug */, + 14E3FED7175FB2E900C857C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 14E3FE9E175FB2E800C857C6 /* Project object */; +} diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.h b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.h new file mode 100644 index 000000000..85547e847 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import + +@interface AppDelegate : UIResponder +{ + UIWindow *_window; + UINavigationController *_navigationController; + UISplitViewController *_splitViewController; +} + +@property (nonatomic, retain) UIWindow *window; + +@property (nonatomic, retain) UINavigationController *navigationController; + +@property (nonatomic, retain) UISplitViewController *splitViewController; + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m new file mode 100644 index 000000000..11528df02 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import "AppDelegate.h" + +#import "MasterViewController.h" + +#import "DetailViewController.h" + +@implementation AppDelegate + +@synthesize window = _window; +@synthesize navigationController = _navigationController; +@synthesize splitViewController = _splitViewController; + +- (void)dealloc +{ + [_window release]; + [_navigationController release]; + [_splitViewController release]; + [super dealloc]; +} + +- (BOOL)application:(UIApplication *) __unused application didFinishLaunchingWithOptions:(NSDictionary *) __unused launchOptions +{ + self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; + // Override point for customization after application launch. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease]; + self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; + self.window.rootViewController = self.navigationController; + } else { + MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil] autorelease]; + UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; + + DetailViewController *detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil] autorelease]; + UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease]; + + masterViewController.detailViewController = detailViewController; + + self.splitViewController = [[[UISplitViewController alloc] init] autorelease]; + self.splitViewController.delegate = detailViewController; + self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil]; + + self.window.rootViewController = self.splitViewController; + } + [self.window makeKeyAndVisible]; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *) __unused 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 *) __unused 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 *) __unused 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 *) __unused 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 *) __unused application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist new file mode 100644 index 000000000..7dc3f1719 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist @@ -0,0 +1,55 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.petroules.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Prefix.pch b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Prefix.pch new file mode 100644 index 000000000..4e3232405 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Prefix.pch @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import + +#ifndef __IPHONE_4_0 +#warning "This project uses features only available in iOS SDK 4.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png new file mode 100644 index 000000000..0891b7aab Binary files /dev/null and b/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png differ diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default.png new file mode 100644 index 000000000..4c8ca6f69 Binary files /dev/null and b/examples/cocoa-touch-application/CocoaTouchApplication/Default.png differ diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png new file mode 100644 index 000000000..35b84cffe Binary files /dev/null and b/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png differ diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.h b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.h new file mode 100644 index 000000000..d8505195c --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import + +@interface DetailViewController : UIViewController +{ + id _detailItem; + UILabel *_detailDescriptionLabel; + UIPopoverController *_masterPopoverController; +} + +@property (nonatomic, retain) id detailItem; + +@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel; + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m new file mode 100644 index 000000000..732ccecd7 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import "DetailViewController.h" + +@interface DetailViewController () +@property (nonatomic, retain) UIPopoverController *masterPopoverController; +- (void)configureView; +@end + +@implementation DetailViewController + +@synthesize detailItem = _detailItem; +@synthesize detailDescriptionLabel = _detailDescriptionLabel; +@synthesize masterPopoverController = _masterPopoverController; + +- (void)dealloc +{ + [_detailItem release]; + [_detailDescriptionLabel release]; + [_masterPopoverController release]; + [super dealloc]; +} + +#pragma mark - Managing the detail item + +- (void)setDetailItem:(id)newDetailItem +{ + if (_detailItem != newDetailItem) { + [_detailItem release]; + _detailItem = [newDetailItem retain]; + + // Update the view. + [self configureView]; + } + + if (self.masterPopoverController != nil) { + [self.masterPopoverController dismissPopoverAnimated:YES]; + } +} + +- (void)configureView +{ + // Update the user interface for the detail item. + + if (self.detailItem) { + self.detailDescriptionLabel.text = [self.detailItem description]; + } +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [self configureView]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + self.title = NSLocalizedString(@"Detail", @"Detail"); + } + return self; +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *) __unused splitController willHideViewController:(UIViewController *) __unused viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"Master", @"Master"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *) __unused splitController willShowViewController:(UIViewController *) __unused viewController invalidatingBarButtonItem:(UIBarButtonItem *) __unused barButtonItem +{ + // Called when the view is shown again in the split view, invalidating the button and popover controller. + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.h b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.h new file mode 100644 index 000000000..605aa1ea8 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import + +@class DetailViewController; + +@interface MasterViewController : UITableViewController +{ + NSMutableArray *_objects; + DetailViewController *_detailViewController; +} + +@property (nonatomic, retain) DetailViewController *detailViewController; + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m new file mode 100644 index 000000000..2962f2ce8 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import "MasterViewController.h" + +#import "DetailViewController.h" + +@implementation MasterViewController + +@synthesize detailViewController = _detailViewController; + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + self.title = NSLocalizedString(@"Master", @"Master"); + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + self.clearsSelectionOnViewWillAppear = NO; + self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); + } + } + return self; +} + +- (void)dealloc +{ + [_detailViewController release]; + [_objects release]; + [super dealloc]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.navigationItem.leftBarButtonItem = self.editButtonItem; + + UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)] autorelease]; + self.navigationItem.rightBarButtonItem = addButton; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)insertNewObject:(id) __unused sender +{ + if (!_objects) { + _objects = [[NSMutableArray alloc] init]; + } + [_objects insertObject:[NSDate date] atIndex:0]; + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; + [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *) __unused tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *) __unused tableView numberOfRowsInSection:(NSInteger) __unused section +{ + return _objects.count; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + } + + + NSDate *object = [_objects objectAtIndex:indexPath.row]; + cell.textLabel.text = [object description]; + return cell; +} + +- (BOOL)tableView:(UITableView *) __unused tableView canEditRowAtIndexPath:(NSIndexPath *) __unused indexPath +{ + // Return NO if you do not want the specified item to be editable. + return YES; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { + [_objects removeObjectAtIndex:indexPath.row]; + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. + } +} + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath +{ +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +- (void)tableView:(UITableView *) __unused tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDate *object = [_objects objectAtIndex:indexPath.row]; + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + if (!self.detailViewController) { + self.detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil] autorelease]; + } + self.detailViewController.detailItem = object; + [self.navigationController pushViewController:self.detailViewController animated:YES]; + } else { + self.detailViewController.detailItem = object; + } +} + +@end diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPad.xib b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPad.xib new file mode 100644 index 000000000..884dc206b --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPad.xib @@ -0,0 +1,223 @@ + + + + 1536 + 12A206j + 2519 + 1172.1 + 613.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1856 + + + IBNSLayoutConstraint + IBProxyObject + IBUILabel + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 274 + + + + 298 + {{20, 495}, {728, 18}} + + + + 3 + MQA + + YES + NO + IBIPadFramework + + 1 + 10 + Detail view content goes here + + 1 + MCAwIDAAA + + 1 + + 1 + 4 + + + Helvetica + 14 + 16 + + + + {{0, 20}, {768, 1004}} + + + + NO + + 2 + + IBIPadFramework + + + + + + + view + + + + 12 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 8 + + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + 81 + + + + + + 94 + + + + + 97 + + + + + 98 + + + + + + + DetailViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 98 + + + 0 + IBIPadFramework + YES + 3 + YES + 1856 + + diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPhone.xib b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPhone.xib new file mode 100644 index 000000000..6c3802521 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/DetailViewController_iPhone.xib @@ -0,0 +1,253 @@ + + + + 1536 + 12A269 + 2835 + 1187 + 624.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1919 + + + IBNSLayoutConstraint + IBProxyObject + IBUILabel + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 298 + {{20, 265}, {280, 18}} + + + + + 3 + MQA + + YES + NO + IBCocoaTouchFramework + Detail view content goes here + + 1 + MCAwIDAAA + darkTextColor + + + 1 + 10 + 1 + + 1 + 4 + + + Helvetica + 14 + 16 + + + + {{0, 20}, {320, 548}} + + + + + 3 + MQA + + 2 + + + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + detailDescriptionLabel + + + + 6 + + + + + + 0 + + + + + + 1 + + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + 7 + + + + + 9 + + + + + 11 + + + + + + + DetailViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 11 + + + 0 + IBCocoaTouchFramework + YES + 3 + YES + 1919 + + diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/InfoPlist.strings b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/InfoPlist.strings new file mode 100644 index 000000000..b92732c79 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/InfoPlist.strings @@ -0,0 +1 @@ +/* Localized versions of Info.plist keys */ diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPad.xib b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPad.xib new file mode 100644 index 000000000..2b4dba21c --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPad.xib @@ -0,0 +1,152 @@ + + + + 1536 + 12A206j + 2519 + 1172.1 + 613.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1856 + + + IBProxyObject + IBUITableView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 274 + {{0, 20}, {320, 832}} + + + + 3 + MQA + + YES + + 2 + + + IBUISplitViewMasterSimulatedSizeMetrics + + YES + + + + + + {320, 852} + {320, 768} + + + IBIPadFramework + Master + IBUISplitViewController + + IBUISplitViewControllerContentSizeLocation + IBUISplitViewControllerContentSizeLocationMaster + + + IBIPadFramework + YES + 1 + 0 + YES + 44 + 22 + 22 + + + + + + + view + + + + 3 + + + + dataSource + + + + 4 + + + + delegate + + + + 5 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + MasterViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 5 + + + 0 + IBIPadFramework + YES + 3 + YES + 1856 + + diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPhone.xib b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPhone.xib new file mode 100644 index 000000000..1000ecf2d --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/en.lproj/MasterViewController_iPhone.xib @@ -0,0 +1,147 @@ + + + + 1536 + 12A269 + 2835 + 1187 + 624.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1919 + + + IBProxyObject + IBUITableView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + {{0, 20}, {320, 548}} + + + + + 3 + MQA + + YES + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + IBCocoaTouchFramework + YES + 1 + 0 + YES + 44 + 22 + 22 + + + + + + + view + + + + 3 + + + + dataSource + + + + 4 + + + + delegate + + + + 5 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + MasterViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 5 + + + 0 + IBCocoaTouchFramework + YES + 3 + YES + 1919 + + diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/main.m b/examples/cocoa-touch-application/CocoaTouchApplication/main.m new file mode 100644 index 000000000..69dcd9e17 --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/main.m @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + [pool release]; + return retVal; +} -- cgit v1.2.1