AddressBook_iPhoneOS_Framework

合集下载

AddressBook(地址薄)

AddressBook(地址薄)

AddressBook(地址薄)<?xml version="1.0" encoding="UTF-8"?><?import javafx.scene.Scene?><?import yout.*?><?import javafx.scene.control.*?><?import javafx.scene.control.cell.PropertyValueFactory?><?import javafx.collections.FXCollections?><?import addressbook.*?><Scene xmlns:fx="/fxml" fx:controller="addressbook.Controller"stylesheets="addressbook/addressbook.css"><GridPane styleClass="grid-pane"><Label id="address-book" text="%addressBook"GridPane.columnIndex="0" GridPane.rowIndex="0"/><TableView fx:id="tableView" tableMenuButtonVisible="true"GridPane.columnIndex="0" GridPane.rowIndex="1"><columns><TableColumn fx:id="firstNameColumn"text="%firstName" prefWidth="100"><cellValueFactory><PropertyValueFactory property="firstName"/></cellValueFactory><cellFactory><FormattedTableCellFactory alignment="CENTER"addRowContextMenu="true"/></cellFactory></TableColumn><TableColumntext="%lastName" prefWidth="100"><cellValueFactory><PropertyValueFactory property="lastName"/></cellValueFactory></TableColumn><TableColumntext="%email" prefWidth="210" sortable="false"><cellValueFactory><PropertyValueFactory property="email"/></cellValueFactory></TableColumn></columns><Person firstName="Jacob" lastName="Smith"email="jacob.smith@"/><Person firstName="Isabella" lastName="Johnson"email="isabella.johnson@"/><Person firstName="Ethan" lastName="Williams"email="ethan.williams@"/><Person firstName="Emma" lastName="Jones"email="emma.jones@"/><Person firstName="Michael" lastName="Brown"email="michael.brown@"/><sortOrder><fx:reference source="firstNameColumn"/></sortOrder></TableView><HBox styleClass="h-box" GridPane.columnIndex="0" GridPane.rowIndex="2"><TextField fx:id="firstNameField" promptText="%firstName"prefWidth="90"/><TextField fx:id="lastNameField" promptText="%lastName"prefWidth="90"/><TextField fx:id="emailField" promptText="%email"prefWidth="150"/><Button text="%add" onAction="#addPerson"/></HBox></GridPane></Scene>/*** An address book application.** @author HAN*/package addressbook;# Title of windowtitle=FXML Address Book# Name of label above the table viewaddressBook=Address Book# Name of the first table column# & Prompt text of text field for the first table columnfirstName=First Name# Name of the second table column# & Prompt text of text field for the second table columnlastName=Last Name# Name of the third table column# & Prompt text of text field for the third table columnemail=Email Address# Name of button for adding rows to tableadd=Add# Title of windowtitle=FXML\u5730\u5740\u7C3F# Name of label above the table viewaddressBook=\u5730\u5740\u7C3F# Name of the first table column# & Prompt text of text field for the first table columnfirstName=\u540D\u5B57# Name of the second table column# & Prompt text of text field for the second table columnlastName=\u59D3# Name of the third table column# & Prompt text of text field for the third table columnemail=\u7535\u5B50\u90AE\u4EF6# Name of button for adding rows to tableadd=\u6DFB\u52A0.grid-pane {-fx-alignment: center;-fx-hgap: 10;-fx-vgap: 10;-fx-padding: 10;}#address-book {-fx-font: NORMAL 20 Tahoma;}.h-box {-fx-spacing:10;-fx-alignment: bottom-right;}package addressbook;import java.text.Format;import javafx.event.ActionEvent;import javafx.event.EventHandler;import javafx.geometry.Pos;import javafx.scene.Node;import javafx.scene.control.ContextMenu;import javafx.scene.control.MenuItem;import javafx.scene.control.TableCell;import javafx.scene.control.TableColumn;import javafx.scene.control.TableRow;import javafx.scene.text.TextAlignment;import javafx.util.Callback;public class FormattedTableCellFactory<S, T> implementsCallback<TableColumn<S, T>, TableCell<S, T>> {/*** The alignment for both the multiline text and label position within cell. */private TextAlignment alignment;/*** Specify a Format if required to format the cell item.*/private Format format;/*** This variable is set because normally only one time of adding context * menu to table row is needed. So be aware of cooccurrence when setting * cell factory for multiple columns.*/private boolean addRowContextMenu;public TextAlignment getAlignment() {return alignment;}public Format getFormat() {return format;}public boolean getAddRowContextMenu() {return addRowContextMenu;}public void setAlignment(TextAlignment alignment) {this.alignment = alignment;}public void setFormat(Format format) {this.format = format;}public void setAddRowContextMenu(boolean addRowContextMenu) { this.addRowContextMenu = addRowContextMenu;}@Overridepublic TableCell<S, T> call(TableColumn<S, T> arg0) {final TableCell<S, T> cell = new TableCell<S, T>() {@Overrideprotected void updateItem(T item, boolean empty) {if (item == getItem()) {return;}super.updateItem(item, empty);if (item == null) {setText(null);setGraphic(null);} else if (item instanceof Node) {setText(null);setGraphic((Node) item);} else if (format != null) {setText(format.format(item));setGraphic(null);} else {setText(item.toString());setGraphic(null);}if (addRowContextMenu)addCM(this);}};if (alignment == null)alignment = TextAlignment.LEFT;cell.setTextAlignment(alignment);switch (alignment) {case CENTER:cell.setAlignment(Pos.CENTER);break;case RIGHT:cell.setAlignment(Pos.CENTER_RIGHT);break;default:cell.setAlignment(Pos.CENTER_LEFT);}return cell;}private MenuItem delete = new MenuItem("Delete");private ContextMenu contextMenu = new ContextMenu(delete);private void addCM(final TableCell<S, T> cell) {@SuppressWarnings("rawtypes")final TableRow row = cell.getTableRow();delete.setOnAction(new EventHandler<ActionEvent>() {@Overridepublic void handle(ActionEvent e) {cell.getTableView().getItems().remove(row.getItem());}});if (row != null) {if (row.getItem() != null) {row.setContextMenu(contextMenu);}}}}package addressbook;import javafx.beans.property.SimpleStringProperty;import javafx.beans.property.StringProperty;/*** A Bean convention based data model.** @author HAN*/public class Person {private StringProperty firstName = new SimpleStringProperty(); private StringProperty lastName = new SimpleStringProperty(); private StringProperty email = new SimpleStringProperty();public Person() {this("", "", "");}public Person(String firstName, String lastName, String email) { setFirstName(firstName);setLastName(lastName);setEmail(email);}public final String getFirstName() {return firstName.get();}public final String getLastName() {return lastName.get();}public final String getEmail() {return email.get();}public final void setFirstName(String firstName) {this.firstName.set(firstName);}public final void setLastName(String lastName) {stName.set(lastName);}public final void setEmail(String email) {this.email.set(email);}public StringProperty firstNameProperty() {return firstName;}public StringProperty lastNameProperty() {return lastName;}public StringProperty emailProperty() {return email;}}package addressbook;import javafx.fxml.FXML;import javafx.scene.control.TableView;import javafx.scene.control.TextField;public class Controller {@FXMLprivate TableView<Person> tableView;@FXMLprivate TextField firstNameField;@FXMLprivate TextField lastNameField;@FXMLprivate TextField emailField;@FXMLprivate void addPerson() {tableView.getItems().add(new Person(firstNameField.getText(), lastNameField.getText(), emailField.getText()));firstNameField.clear();lastNameField.clear();emailField.clear();}}package addressbook;import java.util.Locale;import java.util.Map;import java.util.ResourceBundle;import javafx.application.Application;import javafx.fxml.FXMLLoader;import javafx.scene.Scene;import javafx.stage.Stage;public class Model extends Application {public static void main(String[] args) {launch(args);}@Overridepublic void start(Stage stage) throws Exception {Locale locale = getCurrentLocale();ResourceBundle resources = ResourceBundle.getBundle("addressbook/addressbook", locale,Model.class.getClassLoader());stage.setTitle(resources.getString("title"));stage.setScene((Scene) FXMLLoader.load(Model.class.getResource("View.fxml"), resources));stage.show();}private Locale getCurrentLocale() {Map<String, String> namedParams = getParameters().getNamed(); String languageParam = namedParams.get("language");String countryParam = namedParams.get("country");Locale locale = Locale.getDefault();if (languageParam != null && languageParam.trim().length() > 0) { if (countryParam != null && countryParam.trim().length() > 0) {locale = new Locale(languageParam.trim(), countryParam.trim()); } else {locale = new Locale(languageParam.trim());}}return locale;}}。

东芝305说明书

东芝305说明书
Trademarks
y The official name of Windows 2000 is Microsoft Windows 2000 Operating System. y The official name of Windows XP is Microsoft Windows XP Operating System. y The official name of Windows Vista is Microsoft Windows Vista Operating System. y The official name of Windows 7 is Microsoft Windows 7 Operating System. y The official name of Windows Server 2003 is Microsoft Windows Server 2003 Operating System. y The official name of Windows Server 2008 is Microsoft Windows Server 2008 Operating System. y Microsoft, Windows, Windows NT, and the brand names and product names of other Microsoft products are
Chapter 1 START-UP AND INTERFACE
Running the AddressBook Viewer.......................................................................................... 6 Running the AddressBook Viewer from the start menu......................................................... 6 Running the AddressBook Viewer from a N/W-Fax driver .................................................... 7

iOS英文术语对照

iOS英文术语对照

英文术语对照安装MAC与XCode、XCode工具快速入门:appl e:苹果公司。

mac,Macintosh:由苹果公司设计生产并且运行Mac OS操作系统的个人电脑产品。

Mac OS:是一套运行于苹果Macintosh系列电脑上的操作系统。

iPhone:iPhone是苹果公司旗下的一个智能手机系列,此系列的手机搭载苹果公司研发的iOS手机操作系统。

iOS:iPhone OS,是由苹果公司为移动设备所开发的操作系统,支持的设备包括iPhone、iPod touch、iPad、Appl e TV。

BSD:Berkeley Software Distribution,伯克利软件套件,是Unix的衍生系统,Mac OS的核心。

Snow Leopard:雪豹,mac os的一个版本。

Lion:狮子,mac os的一个版本。

Mountion Lion:山狮,mac os的一个版本。

Find er:发现者,mac下的资源浏览器。

App Store:应用商店。

NeXT:NeXT软件公司。

Xcod e:苹果公司向开发人员提供的集成开发环境,用于开发Mac OS X和iOS的应用程序。

assistant editor:辅助编辑区域。

buil d:构建、编译。

run:构建、编译并运行。

d ebugger:调试器。

id entity inspector:标识检视面板navigator:导航面板。

OC基础语法与流程控制Objective-c:OC:Objective-C是一种通用、高级、面向对象的编程语言。

是苹果的OS X 和iOS 操作系统,及其相关API、Cocoa 和Cocoa Touch 的主要编程语言。

Cocoa:苹果公司为Mac OS X所创建的原生面向对象的编程环境。

Foundation:通用的面向对象库。

framework:框架,通常指的是为了实现某个业界标准或完成特定基本任务的软件组件规范,也指为了实现某个软件组件规范时,提供规范所要求之基础功能的软件产品。

苹果开发者指南说明书

苹果开发者指南说明书

A■alloc/copy method, 286Animator proxy, 325Apple Developer Connection (ADC), 2 applicationDidFinishLaunching:method, 94, 284, 287, 290 applicationDidFinishLaunching: delegatemethod, 273 applicationWillTerminate: method, 223 Assistant editor, 332Attributes, 156details attribute, 159divinity, goodness, 159editing, 159MythicalPerson entity, 158Optional, 158power, 159Transient, 158Unsupported Types, 160Attributes Inspector, 229, 306, 333, 354, 360 B■Bindings Inspector, 307C■Cappuccino, 384, 387Catching exceptions, 272 CMColorBlendView classblended colors to GUIbinding configuration, 266bind:toObject:withKeyPath:, 266@class declaration, 262CMDocument.h file, 262CMDocument.m, 265final output, 267#imports, 262list of connections, 264–265Size Inspector, 262soon-to-be-blended colors grid, 263–264windowControllerDidLoadNib:method, 265CGColorRefs, 261CMColorBlendView.m, 259drawRect: method, 260drawRect: mode, 259editing CMColorBlendView.h, 259@implementation section, 260@implementation, 261nonatomic, 259NSColor objects, 259subclass of NSView class, 259@synthesize, 259–260CMDocument class, 257Cocoaclasses, 1drawingautomatic reference counting, 316Bezier curve, 315–316Bezier plumbing, 318–319CEAppDelegate.h file, 316CECurveView, 316, 318control point, 323–324core animation (see Core animation)curve drawing, 320–321CurveEdit, 316custom view, 316frame rectangle vs. boundsrectangle, 296–297fundamentals, 295–296.h file, 317LOLmaker (see LOLmaker).m file, 317Index389mouse activity, 321–323NSRect, 297NSSize, 297NSView subclass (see NSView subclass)paths, 297view coordinate system, 296 site, 3Mac application, 2NeXTStep AppKit, 1Objective-C, 3object-oriented frameworks, 1OS X uses, 2programming knowledge, 3source code, 2Xcode, 2Cocoa bindingsDungeonThing project and preferenceswindowAttributes Inspector, 126Character Generationpreferences, 127Dungeon Generationpreferences, 129MainMenu.xib, 126Monster Generation preferences, 129Object Library pane, 126Tab View addition, 127Main Window creationAttributes Inspector, 134DungeonThingAppDelegate(see DungeonThingAppDelegate)Object Library pane, 134Size Inspector, 134text field creation, 134NSUserDefaultsControllerNSUserDefaultsController(see NSUserDefaultsController) Table ViewArray Controller, 145configuration, 143DungeonThingAppDelegate.h, 142DungeonThingAppDelegate.m file, 142init method, 142key-value coding, 149key-value observing, 150table display, 147text field, 147Cocoa skillsblocksfiltering, 381Grand Central Dispatch, 377init and dealloc methods, 379MyController instance, 380notification-handling code, 379NSEnumerator, 378–379NSNotification, 379observation, 379observation object, 380weakSelf, 381foreign languageF-Script, 385JavaScript, 384–385MacRuby, 383Nu, 384Objective-C and C++, 382PyObjC, 382GUI objects, 375MVC pattern, 375NSNotification, 376, 377ported (see Ported Cocoa)Cocoa Touch, 385–386Cocotron, 386ColorMix application, 253–254blend modes, 254CMColorBlendView class(see CMColorBlendView class) CMDocument class, 254Core Data, 254Core Graphics, 254data model, 255file format, 258nib files, 255NSDocument architecture, 254setting two colorsColorSet creation, 257GUI creation, 256NSObjectController, 256NSTextField, 255undo and redo, 268ColorSet object, 256, 257ConcurrencyGCD (see Grand Central Dispatch (GCD)) SlowWorkerdefinition, 358doWork: method, 364Cocoa (cont.)Editable checkbox, 360inaction, 358isWorking, 359Mac OS X’s Force Quit window, 361NSBlockOperation, 365single action method, 364SWAppDelegate.h, 358SWAppDelegate.m, 359threadAppKit classes, 365Attributes Inspector, 368closures, 362doWork: method, 366GCD, 363Indeterminate Progress Indicator, 369main thread, 361mutex, 361NSTextView, 365operating systems, 361operation queues, 362Start button: method, 367SWAppDelegate.h, 368SWAppDelegate.m, 368thread-safe, 361Units of Work, 362Value Transformer, 368 contentView, 296Core animationbasics, 325explicit animationsanimation layers, 328animator proxy, 328CABasicAnimation class, 327, 329CECurveView, 330–331MovingButton target, 329NSPanel, 331QuartzCore framework, 327timing function, 332grouping animationsANIM_DURATION, 335applicationDidFinishLaunching:method, 336–337assistant editor, 332attributes inspector, 333currentTabIndex, 336display window, 333FIAppDelegate.h file, 335FIAppDelegate.m class, 335FlipIt, 332@implementation block, 336items property, 336matching methods, 339–340NSArray, 336NSBox, 333NSInteger scalar property, 335NSTabView, 334NSView subclass, 334Object dock, 334prepareRightSide method, 336transitionInFromRightmethod, 336–337transitionOutToLeft method, 338transitions, 332implicit animations, 325–326Core databusiness logicCustom Attribute creation, 186Multiple Attributes validation, 184MythicalPerson class, 182Single Attributes validation, 183 CocoaBindings Inspector, 166managedObjectContext, 166MBAppDelegate, 166Model Key Path field, 167NSArrayController, 166NSImage, 168NSMutableDictionary, 166predicates, 171saveAction, 171table view, 168GUIAttributes Inspector, 161, 164Column Sizing, 161MainMenu.xib file, 161Mythical Details management, 164NSScrollView, 164NSTextField, 165NSTextView, 164Object Library, 161–162table view, 162integration with Cocoa bindings, 154MythBase creationattributes (see Attributes)Automatic ReferenceCounting, 155entities, 156Entity creation, 157relationships, 156Xcode’s model editor, 157NSMutableDictionary, 153persistence, 154template vode (see Template code)undo/redo support, 154Core data relationshipsArray Controller, 200entity modelattributes, 192configuration options, 194Delete Rule pop-up, 194destination pop-up, 194migration, 195multiple model versions, 191MythBase, 190one-to-many relationship, 193, 195run, 195to-many relationship, 194–195versioning and migrations, 191 GUI updationarrangedObjects, 201Attributes Inspector, 203band Grecian Formula, 202band window, 197Bindings Inspector, 201, 203–204Cocoa bindings, 198–199Content Mode, 203Gig List, 205Model Key Path, 202Mythical Bands controller, 201Mythical Bands window, 204Mythical People window, 200–201NSArrayController, 203pop-up button, 200venue window, 204MythBase application, 190D■DATA_RECEIVED notification, 376 dealloc method, 377, 379dispatch_async, 371dispatch_get_global_queue() function, 372 Distributed Objects (DO) technology, 283Document-based applicationColorMix (see ColorMix application)NSDocument class, 253doWork: method, 364 DungeonThingAppDelegateaction methods, 138constants definition, 136default preferences values specification, 137 E■ECAppDelegate, 273 enumerateKeysAndObjectsUsingBlock:, 379 enumerateObjectsUsingBlock:, 378 esNSDocumentController class, 253 Exception handlingcatching exceptions, 272Cocoa, 273debugger, 275Debug Navigator, 277definition, 271ECAppDelegate, 273invalidArgumentException_unrecognizedSelector method, 275 NSException class, 271NSInvalidArgumentException, 279–281NSRangeException, 282–283objc_exception_throw function, 278rax, 279Xcode’s Breakpoint Navigator, 276F■fileError method, 290File handlinghigh-level file operation (seeWhatAboutThatFile application) implicit file accessclasses, 341content interpretation, 341NSData, 342NSPropertyListSerialization class, 342property-list format, 341writeToFile, 342File-system attributes, 342FlipIt, 332freedObject method, 287F-Script, 385Core data (cont.)G■GNUstep, 386Grand Central Dispatch (GCD)NSOperationQueue, 370SlowWorkerconcurrent Blocks, 373dispatch_get_main_queue( )function, 372SlowWorker’s doWork: method, 370, 372 GUI component, 67Cocoa UI elements, 67–68codingdefault villain, 93input, 99key names, 92–93updateDetailViews(see updateDetailViews)NSButton, 68NSControl, 67VillainTrackerAppDelegate classconnections inspector, 90delegate method, 90GUI class, 85notesView property, 91NSMutableDictionary, 91outlet/action, 85–87run button, 92self.villain, 92setVillain, 91takeLastKnownLocation, 88–89takeLastSeenDate, 85VillainTracker applicationbox view, 81check box, 78combo box, 73date picker, 72image view, 77level indicator, 74MainMenu.xib, 70MVC design, 69NSView, 69pop-up button, 79radio buttons, 75resizing, 83text field, 70text view, 80VillainTracker.xcodeproj, 70H■Human Interface Guidelines (HIG), 14I■Identity inspector, 298, 306@implementation block, 257Indeterminate Progress Indicator, 369@interface block, 257init method, 257initWithObjectsAndKeys method, 93 initWithType: error, 258 invalidArgumentException_unrecognizedSelector method, 275, 281 isWorking, 359J■JavaScript, 384–385JSCocoa, 384K■keyPathsForValuesAffectingFileIcon class, 345 keyPathsForValuesAffectingFilenameclass, 345L■localizedDescription, 291LOLmakerattributes inspector, 306bindings inspector, 307bitmap drawing, 309–310identity inspector, 306LOLAppDelegate.h file, 306LOLAppDelegate.m, 307LOLcat-style imagery, 305LOLView, 308–309scrolling, 310–312text drawing, 312–313Value attribute, 307window, 306–307M■MacRuby, 383MacRuby Language, 383MainMenu.xib, 360, 367Mission Control, 230Modal Windowsalert function, 242open and save panels, 243Run Modal Alerts, 243Model–view–controller (MVC), 29 Mutex, 361MyController class, 259MythBase, 209N■nib-defined predicate, 218Nib fileAttributes Inspectoralignment buttons, 18font and size, 18Interface Builder, 16–17label’s attributes, 17Mac OS X color picker, 18–19NSTextField class, 17system-default font, 19–20blue guidelines, 13–14Editor, 11Inspectorattributes, 14definition, 14Interface Builder’s Inspectors, 15user interface, 11Interface Builder mode, 11Label, 12–13Library, 11–12 NSArrayController, 211, 213, 216, 218 NSArray’sindexesOfObjectsPassingTest: method, 381 NSCocoaErrorDomain, 289 NSDocument class, 253 NSDocumentController class, 253, 255 NSErrorapplicationDidFinishLaunching: method domains and codes, 288–289error-generating method, 290fileError method, 290fileManager, 291file-related errors, 288localizedDescription, 291NSFileManager class, 289NSString, 291po command, 292presentError: method, 293 NSInvalidArgumentException, 279–281 NSManagedObjectContextobject, 269NSOperation, 362 NSOperationQueue, 362 NSOSStatusErrorDomain, 289 NSPersistentDocument, 257 NSPOSIXErrorDomain, 289NSPredicatecreation, 216NSAppController, Xcode, 218QuoteMonger (see QuoteMonger)saving, 222user-defined predicatesapp delegate, 219editor configuration, 220nib-defined predicate, 218NSPredicateEditor, 218Search window, 220 NSPredicateEditor, 209, 218 NSPredicateEditorRowTemplate, 221 NSPropertyListSerializationclass, 342 NSRangeException, 282–283NSRect, 297NSTableCellView, 108NSTextField class, 17NSUserDefaults, 222–223 NSUserDefaultsControllercharacter generationcharacterClassAllowedBard,Fighter, 133characterClassAllowedPaladin key, 133characterMaxNameLength, 132Max Value, 130Min Value, 130NSUserDefaults, 132NSUserDefaultsController, 132Selected Tag attribute, 133Dungeon Generation, 133Monster Generation, 133NSView subclassboundariesinitWithFrame: method, 304resizing, 303–304setFrameSize: method, 304–305stretching, 305view position and size, 304 CGRectInset, 301drawRect: method, 298, 301graphics context, 300graphics states, 299identity inspector, 298MainMenu.xib file, 298manual path construction, 302path helpers, 299size inspector, 298NSWindow and NSPanelApple’s Human InterfaceGuidelines, 226input handling, 227panel use, 228System Panels (see System Panels) Window Attributes, 228windows sample, 227 NSWindowControllerNib loadingARC system, 237Easy Window, 238File’s Owner, 238Load Easy Window, 237subclassing, 239NSWorkspace class, 345Nu language, 384O■objc_exception_throw function, 278 objectAtIndex: method, 282 objectController, 257–258Objective-C compilercontroller class creationAssistant Editor, 59ButtonAppDelegate class, 59ButtonsAppDelegate.m, 60control-dragging, 59–60implementation, 61label property, 60nib file, 59Xcode, 59delegate applicationButtonsAppDelegate class, 63configuration, 63Documentation Browser, 64main( ) function, 62NSApplication, 62outlet and actionAttributes Inspector, 52Autosave field, 53Cocoa application, 49, 50control-dragging, 48IBAction, 48I-beam, 55IBOutlet, 47interface builder, 49MainMenu.xib, 50method, 48Minimize checkbox control, 53nameField, 47placeholder object, 51Resize control, 53Size Inspector, 53–54Window Interface (see WindowInterface)Xcode, 48Objective-J, 387P■po command, 292Ported CocoaCappuccino/Objective-J, 387Cocoa Touch, 385–386GNUstep and Cocotron, 386Mac software, 385 presentError: method, 293PyObjC Language, 382Q■QMAppDelegate.h file, 219 QMAppDelegate.m, 219, 222 Quartz, 295Quote entity, 210QuoteMongerdata entry window, 209–210initial quotes, 214MainMenu.xib, 211NSWindow instance, 211Quote entity, 211Quote Finder window, 215quoting Quotes, 213Show entity, 211showing Shows, 211project and data model creation, 210 search window, 209–210R■Responder chain, 233 resultsTextView property, 359S■searchPredicate property, 219 setName: method, 269Sheets, 251Show entity, 210Signalalloc/copy method, 286applicationDidFinishLaunching:method, 284, 287ARC, 286Cocoa programmers, 284freedObject method, 287NSMutableString*, 284Objective-C object, 284release or autoreleasemessage, 287SIGSEGV/SIGILL, 285Size Inspector, 298SlowWorker, 358, 361 stringEncodingName method, 347 SWAppDelegate.h, 358, 368 SWAppDelegate.m, 359, 368System MenusbindingsBoolean attribute, 245menu items setting up, 247turbo property, 246Value binding, 247Value Transformer, 247first responderaction method, 250flowchart, 248menu items, 249new window creation, 249Object Library, 250responder chain, 248own menus, 245single horizontal strip, 245standard application menu, 245Windows application, 245System Panelscolor panelMultiline Label, 232responder chain, 233Show Color Panel, 232Text Color, 234window layout, 231Font Panel, 234T■Table viewaddition and deletion method, 103Attributes Inspector, 105–106code editioncolumn identifier method, 118dataSource and delegate outlet, 117delegate method, 116delete villain: method, 120edition, 122isEqual: method, 121lazy loading, 117method, 118Project Navigator, 116selectRowIndices, 116Villains addition, 118Villains selection, 119VillainTrackerAppDelegate.m, 117 Column Size, 106Content Mode, 107data collection, 103Identity Inspector, 108Image combo box, 108mugshot, 108NSAddTemplate, 108NSTableColumn, 108Object Library, 106, 108Project Navigator panel, 105resize/constraints, 109appearance box, 113–114blue line guidelines, 111Cocoa Auto Layout, 111Content Hugging control, 111edition, 114–115QuoteMonger (cont.)interface builder pane, 112myButton, 111resize handle, 110scrollview selection, 107Table View Cell, 108VillainTrackerAppDelegate, 109VillainTrackerAppDelegate class’sinterface, 103VillainTrackerAppDelegate preparation, 104 Template codeApp Delegate implementationaction method, 179applicationSupportDirectorymethod, 174managedObjectContext accessormethod, 178managedObjectModel accessormethod, 175NSApplication delegate method, 180NSWindow delegate method, 179persistentStoreCoordinator accessormethod, 176App Delegate interface, 173U■UILabel object, 256Undo stack, 268updateDetailViewsapplicationDidFinishLaunchingmethod, 96evilnessView, 95fast enumeration, 98lazy loading, 96powers, 98primaryMotivation, 96–98setStringValue:, 94swornEnemy, 95User-interface control, 107User interfacescontroller classes, 30frameworksAppKit, 28Cocoa framework, 28definition, 27foundation framework, 28MVC model, 29OS X unique, 27outlets and actionsaction method, 30akeIntValueFrom, 43–44Attributes Inspector, 33, 36BookAppDelegate, 31Cocoa Simulator, 43Connections Inspector, 41–42control-dragging, 39–40integral values, 92Interface Builder mode, 32label properties, 33laying out User Interface controls, 35NSTextField class, 34Object Library, 33–35outlets definition, 30project settings, 31–32resize, 37–38slider, 37–39takeDoubleValueFrom, 42, 44Text Fields, 35–36View section, 33Xcode, 31V■VillainTrackerAppDelegate classconnections inspector, 90delegate method, 90GUI class, 85notesView property, 91NSMutableDictionary, 91outlet/action, 85–87run button, 92self.villain, 92setVillain, 91takeLastKnownLocation, 88–89takeLastSeenDate, 85VillainTracker applicationbox view, 81check box, 78combo box, 73date picker, 72image view, 77level indicator, 74MainMenu.xib, 70MVC design, 69NSView, 69pop-up button, 79radio buttons, 75resizing, 83text field, 70text view, 80VillainTracker.xcodeproj, 70W■weakSelf, 381WhatAboutThatFile applicationcharacter string, 343codeapplicationDidFinishLaunchingmethod, 344chooseFile method, 344chosenEncoding property, 344Cocoa bindings, 344encodingNames method, 346error checking, 348error handling, 344fileAttributes, 346keyPathsForValuesAffectingFileIcon, 345keyPathsForValuesAffectingFilename, 345MainMenu.xib, 343NSString, 346NSWorkspace class, 345setStringEncodingName method, 348stringEncodingName method, 347WATAppDelegate class, 343GUIarrangedObjects controller key, 353file attributes, 352file selection, 350–351MainMenu.xib, 349NSDictionaryController class, 353Opens Application, 351–352pop-up button, 355string encoding, 354text view, 353–354window components, 349 windowControllerDidLoadNib:method, 257–258Window Interfaceblue guidelines, 56–57font panel, 58GUI object, 58Interface Builder pane, 58Object Library, 55–56writeToFile method, 342X, Y, Z■Xcodearchive build process, 24–25Cocoa Application icon, 5–6Editor pane, 9icon application, 20–22Mac App Store, 6MainMenu.xib., 10Navigator pane, 9nib file (see Nib file)project options, 6–7project’s main window, 8–9property list, 22–23run, 23–24save location, 7–8XML-based format, 10VillainTracker application (cont.)。

单独编译framework

单独编译framework

单独编译framework单独编译frameworkFramework是iOS开发中常用的一种代码结构,可以将一些常用的功能或库代码封装成独立的模块,方便在不同项目中复用。

这些模块一般被编译成一个单独的库,成为framework。

在iOS应用开发中,我们经常会使用系统提供的一些framework库,比如UIKit、Foundation等。

同时,我们也可以自己编写framework,并供其他开发者使用。

编写一个framework的过程可以分为三个步骤:创建framework项目,添加需要封装的代码,最后将framework编译成库文件。

一般来说,我们将封装的代码放到一个专门的文件夹中,通过在Build Settings中配置Header Search Paths来告诉编译器头文件的位置,再在Build Phases > Compile Sources中添加要编译的源文件即可。

完成代码编写后,我们需要将framework编译成库文件。

一般情况下,我们可以通过选择Product > Archive来自动构建和打包framework。

如果需要手动打包,可以打开终端,将目录切换到framework文件所在的目录,执行如下命令:xcodebuild -configuration “Release” -target "xxx" -arch "xxx" -sdk iphoneos其中,xxx表示具体的framework名称、架构类型和SDK版本。

通过上述步骤,我们就可以生成一个可单独使用的framework库文件了。

在其他项目中使用这个库也很简单,只需要将.framework文件添加到项目中,然后在Build Phases > Link Binary With Libraries中添加即可。

总之,编写和使用framework可以提高代码的重用性和开发效率,值得开发者在实践中掌握。

如何编译framework

如何编译framework

如何编译framework编译framework是一个相对较为复杂的过程,需要注意很多细节。

下面将为您介绍一些常用的编译framework的方法。

第一种方法是使用Xcode中自带的工具进行编译。

首先需要在Xcode 的左侧栏中找到Targets,然后双击你要编译的framework,进入Build Settings选项卡,将Build Active Architecture Only设置为NO,然后在Build Options中选择 Always Embed Swift Standard Libraries,最后在Build Phases选项卡中配置你的Sources和Frameworks即可开始编译。

第二种方法是使用命令行工具进行编译。

首先需要进入framework的根目录,然后使用以下命令行工具进行编译:xcodebuild -project YourFramework.xcodeproj -scheme YourFramework -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.5' clean build此命令可以编译并在模拟器上测试应用程序。

如果需要编译真机版本,则需要将sdk改为iphoneos,并将destination改为一个真机设备的UDID。

最后,可以使用Carthage工具来构建和管理framework的依赖关系。

Carthage是一个命令行工具,它可以帮助我们将framework与其他依赖项捆绑到一个Cartfile中,并允许我们在项目中使用这些依赖项。

使用Carthage构建framework时,需要在Cartfile中添加所需的依赖项,然后运行以下命令行工具:carthage update --platform iOS这条命令将自动下载和构建所有依赖项,并生成一个.framework文件,以供使用。

xcode使用教程

xcode使用教程

xcode使用教程Xcode是开发iOS和macOS应用程序的集成开发环境(IDE)。

它提供了丰富的工具和功能,帮助开发者编写、调试和部署高质量的应用程序。

下面是一些使用Xcode的基本步骤和常见功能的简介。

1. 下载和安装Xcode:在App Store中搜索Xcode,并进行下载和安装。

安装完成后,您可以在“应用程序”文件夹中找到Xcode。

2. 创建新项目:打开Xcode,选择“创建新的Xcode项目”或通过快捷方式Command+N来创建一个新项目。

选择适合您的应用类型的模板,并填写必要的信息,如项目名称、组织名称和保存位置。

然后点击“下一步”。

3. 选择设备和操作系统:在“设备”下拉菜单中选择您想要在上面运行应用程序的设备,例如iPhone或iPad。

在“部署目标”下拉菜单中选择您的应用程序将要支持的最低操作系统版本。

4. 编写代码:Xcode使用Swift或Objective-C作为主要的编程语言。

您可以在左侧的“导航器”窗格中找到项目文件结构。

在源代码文件中编写和编辑代码。

5. 调试和运行应用程序:您可以使用模拟器来测试和运行您的应用程序。

在Xcode主窗口的顶部中央,有一个设备选择器,您可以选择您要在其上运行应用程序的模拟器或实际设备。

然后点击运行按钮(上方的三角形按钮)来构建和运行您的应用程序。

6. 调试应用程序:如果您的应用程序在运行过程中出现错误或异常情况,您可以使用Xcode的调试工具来找到问题所在。

您可以在源代码中设置断点,以便在特定的代码行暂停执行。

在调试期间,可以检查变量的值、查看堆栈跟踪等。

7. 构建和发布应用程序:当您准备好发布您的应用程序时,您需要从Xcode菜单中选择“Product”>“Archive”来构建应用程序的存档文件。

然后,您可以使用Xcode中的“分发”工具来创建应用程序的分发版本,并将其上传到App Store或通过其他渠道分享给用户。

iOS开发技术手册

iOS开发技术手册

iOS开发技术手册第一章:介绍iOS开发技术iOS是由Apple公司推出的操作系统,它为iPhone、iPad和iPod Touch等设备提供了强大的功能和良好的用户体验。

本章将对iOS开发技术进行简要介绍,帮助读者对iOS开发有一个初步的了解。

1.1 iOS开发概述iOS开发是指使用Objective-C或Swift编程语言开发基于iOS操作系统的应用程序。

iOS开发者可以利用Apple提供的软件开发工具包(SDK)以及相关文档和资源来创建各种类型的应用程序,包括游戏、社交媒体应用、商务应用等。

1.2 iOS开发环境搭建为了进行iOS应用的开发,需要在Mac电脑上搭建相应的开发环境。

具体包括安装Xcode集成开发环境、注册Apple开发者账号等步骤。

本节将详细介绍如何搭建iOS开发环境。

1.3 开发工具和语言iOS开发使用的主要工具是Xcode,它是一款强大的集成开发环境,提供了代码编辑、编译、调试等功能。

此外,Objective-C是一种使用广泛的iOS开发语言,而Swift则是Apple最新推出的一种现代化的开发语言。

本节将介绍如何使用Xcode进行开发,并对Objective-C和Swift进行简要对比。

第二章:iOS开发基础知识在进行iOS开发之前,需要熟悉一些基础知识,包括UIKit框架、界面设计等方面的内容。

本章将系统介绍iOS开发的基础知识,帮助读者打下扎实的基础。

2.1 UIKit框架在iOS应用开发中,UIKit框架是最常用的框架之一。

它包含了一系列用于构建用户界面的类和方法,如按钮、标签、文本框等控件。

本节将介绍UIKit框架的基本使用方法,以及常用控件的创建和操作。

2.2 界面设计好的用户界面设计是吸引用户的关键之一。

本节将介绍iOS开发的界面设计原则和技巧,包括布局、颜色选择、图标设计等方面的内容。

读者可以通过学习这些知识,设计出美观且易用的应用界面。

2.3 数据存储和管理iOS开发中,数据的存储和管理是不可或缺的一部分。

ios framework 中引用framework

ios framework 中引用framework

在iOS开发中,如果您需要在框架中引用另一个框架,可以按照以下步骤操作:
1.在项目的构建设置中,找到“General”选项卡下的“Frameworks, Libraries, and
Embedded Content”部分。

2.在“Frameworks, Libraries, and Embedded Content”部分中,点击“+”按钮,然后从列
表中选择您要引用的框架。

3.选择要添加的框架后,点击“Add”按钮将其添加到项目中。

4.确保在项目的构建设置中正确设置了引用框架的路径。

通常,框架文件会被放置在
项目的“Frameworks”文件夹中。

5.在代码中,您可以通过#import指令来引用添加的框架。

例如,如果您添加了一个名
为MyFramework.framework的框架,则可以在代码中使用以下指令:
objective复制代码
#import <MyFramework/MyFramework.h>
这样就可以在您的框架中使用引用的框架中的类和函数了。

请确保在项目中正确设置和引用框架,以避免编译错误和运行时错误。

ios framework 中的 bundle 路径

ios framework 中的 bundle 路径

在iOS中,framework中的bundle路径是指包含资源文件的目录。

这些资源文件可能包括图像、音频、视频或其他类型的文件。

在iOS中,bundle是一个特殊的目录,它包含应用程序的资源文件,如界面、图像、本地化字符串等。

这些资源文件在编译时会被打包到应用程序中,并且可以通过应用程序的代码访问。

在framework中,bundle路径通常是指包含framework本身的目录。

这个目录中包含了framework的二进制文件和相关的资源文件。

这些资源文件可以通过代码访问,以便应用程序可以使用framework中的功能。

在访问framework中的bundle路径时,可以使用NSBundle类。

这个类提供了访问应用程序的bundle和其资源文件的方法。

例如,可以使用以下代码获取应用程序的bundle路径:
```swift
let bundlePath = Bundle.main.path(forResource: "MyBundle", ofType: "bundle")
```
其中,"MyBundle"是bundle的名称,"bundle"是bundle文件的
类型。

这个方法将返回一个字符串,表示bundle的路径。

如果找不到指定的bundle,则返回nil。

xcode使用手册

xcode使用手册

Xcode 是一款由苹果公司开发的集成开发环境(IDE),用于开发macOS、iOS、iPadOS、watchOS 和tvOS 应用程序。

它包括了代码编辑器、编译器、调试器和图形用户界面设计工具等功能,可以帮助开发人员创建高质量的应用程序。

以下是Xcode 使用手册的一些主要内容:
1. 安装和配置:首先需要下载和安装Xcode,然后进行配置,包括设置开发者账号、设备管理和代码签名等。

安装完成后,可以启动Xcode 并创建新项目。

2. 项目管理:在Xcode 中创建项目,可以选择不同的模板和框架,包括应用程序、工具、游戏、框架等。

在项目中,可以添加文件、资源、库和框架等,并进行版本控制和构建设置等。

3. 编辑器:Xcode 的编辑器提供了代码自动补全、语法高亮、代码折叠、代码重构和代码导航等功能,可以帮助开发人员更高效地编写代码。

4. 调试器:Xcode 的调试器可以帮助开发人员诊断和修复应用程序中的错误和问题。

调试器提供了断点、变量监视器、堆栈跟踪和日志输出等功能,可以帮助开发人员快速定位和解决问题。

5. 设备管理:Xcode 可以连接和管理多个设备,包括模拟器和真实设备。

在设备管理中,可以安装和调试应用程序,进行性能测试和调试等。

6. 发布和分发:在Xcode 中,可以将应用程序打包和分发给用户或发布到App Store。

在发布和分发时,需要进行代码签名、证书管理和应用程序审核等步骤。

以上是Xcode 使用手册的一些主要内容,但是由于Xcode 功能非常丰富,因此建议您参考官方文档和教程,以获取更详细和全面的使用指南。

iOS开发环境的搭建与配置

iOS开发环境的搭建与配置

iOS开发环境的搭建与配置在移动应用开发领域,iOS操作系统的占比逐渐增长,iOS开发者也逐渐成为市场上的热门需求。

作为一名有志于成为iOS开发者的你,搭建和配置一个稳定高效的iOS开发环境是至关重要的。

本文将为你详细介绍iOS开发环境的搭建与配置过程。

第一步,安装和配置XcodeXcode是苹果公司专门为iOS和macOS开发者提供的开发工具。

在搭建iOS开发环境的过程中,首先需要安装和配置Xcode。

打开App Store,搜索Xcode并点击获取按钮进行安装。

安装完成后,你可以在应用文件夹中找到Xcode。

首次打开Xcode时,你需要同意许可协议并进行一些基础设置,例如选择默认的开发者账号和安装必要的组件。

第二步,安装和配置iOS模拟器在iOS开发中,模拟器是一个不可或缺的工具,可以帮助开发者在自己的电脑上测试和调试应用程序。

Xcode自带了iOS模拟器,你可以通过打开Xcode并选择菜单中的"Xcode"->"Preferences"->"Components"来安装不同版本的模拟器。

为了更好地测试应用程序在不同设备上的运行效果,建议安装不同版本和型号的模拟器。

第三步,注册开发者账号苹果公司要求开发者在提交应用程序之前注册一个开发者账号。

这一步将需要一些个人信息和一定的费用。

如果你只是想在自己的设备上测试应用程序,可以使用免费的个人开发者账号。

但如果你计划将应用程序上架到App Store,你需要注册一个付费的企业开发者账号或个人开发者账号。

第四步,配置开发者账号和证书在Xcode中,打开菜单"Xcode"->"Preferences"->"Accounts",点击左下角的"+"按钮,选择"Apple ID"并使用你的开发者账号登陆。

iOS应用开发基础

iOS应用开发基础

iOS应用开发基础随着移动互联网的快速发展,手机成为人们必不可少的生活工具之一,iOS应用开发也日渐成为一个备受瞩目的领域。

本文将介绍iOS 应用开发的基础知识,涉及开发环境搭建、掌握Objective-C语言、UI设计、数据存储以及发布上架等方面。

一、iOS开发环境搭建iOS开发环境主要分为两个部分:开发工具和技术框架。

目前iOS 开发工具主要有Xcode,而技术框架则包括Cocoa Touch框架和Objective-C语言。

Xcode是苹果公司官方提供的开发工具,它可用于开发iOS、iPadOS、macOS、watchOS和tvOS等应用程序。

它是一个完整、集成的开发环境,能够提供代码编辑、编译、调试、性能调优、界面设计、应用分发等功能,是进行iOS应用开发的绝佳选择。

Objective-C是一种C语言的扩展,为iOS开发提供了强大的面向对象编程能力。

它是iOS开发的主要编程语言之一,在iOS开发中大量使用。

Cocoa Touch框架是iOS开发中的重要部分,它为iOS应用提供了许多核心功能,如界面设计、多媒体处理、网络通信等,是进行iOS 应用开发的主要技术框架之一。

二、掌握Objective-C语言Objective-C语言是许多iOS应用开发者必须掌握的语言之一。

它是C语言的扩展,有着完善的面向对象编程能力。

在iOS开发中,Objective-C用于处理界面事件、数据传输和应用逻辑等方面。

以下是Objective-C语言的基础语法:1.声明变量Objective-C语言中的变量声明采用了C语言的风格,变量名和数据类型中间加冒号“:”,基本数据类型包括整型、浮点型等。

int i;float f;NSString *str;2.分支与循环Objective-C中的分支和循环语句与C语言类似,可以使用if..else、for、while等语句。

if(condition) {//执行代码}for(int i=0;i<10;i++) {//执行代码}while(i<10) {//执行代码}3.函数Objective-C语言中的函数与C语言中的函数编写方式基本相同,有返回值类型和参数列表。

Addressfinder 用户指南说明书

Addressfinder 用户指南说明书

Getting StartedStep1Sign up for a FREE Addressfinder account at either https://addressfi.au or https://addressfi.This will provide you with an account key(Step3)and allow you to approve your website’s domain/s for use via this account and key(Step4).Step2Log into your Magento Admin and navigate to the Addressfinder configuration menu under: Stores>Settings>Configuration>Services>AddressfinderStep3Configure the settings1.Uncheck the'Use system value'checkbox2.Set‘Enabled’to Yes3.Paste your Addressfinder licence key into the field4.Paste any address params into the‘Widget Options’area(optional,see WidgetOptions below)5.Save ConfigStep4Skip this step if you already added your domain when signing up for your accountLogin to the Addressfinder Portal(https://portal.addressfi/portal/)and add your domain/s to the list of domains approved on your account.Select the‘Domains’button on the Dashboard page or in the side navigation and add them one at a time.Step5Once your Addressfinder licence key has been set in Magento Admin and you have added your domain in the Addressfinder Portal,the extension is ready to test.Testing Steps:1)check that either Australia or New Zealand is selected in the countryfield.2)type thefirst few characters of an address in the Street Addressfield.A dropdown containing addresses that closely match what you have typed should appear below the Street Addressfield.3)select an address from the dropdown and check that each part of that address populates the correctfield(eg,suburb into the Suburbfield).Repeat the Testing Steps above on the following pages:Checkout-Shipping addressfieldsCheckout-Billing addressfieldsNew Account-AddressfieldsEdit Account-Add new addressAdmin>Order-Shipping addressfields(only on Magento version2.2,2.3&2.4)Admin>Order-Billing addressfields(only on Magento version2.2,2.3&2.4) Checkout>Ship to multiple addresses(the service is not yet configured to work on this page)Step6-Configuration of Widget Options(optional)By default,the service will return Australian addresses from the GNAF address database.If this does not align perfectly with your business needs please configure the widget options box(part4of Step3above)with an appropriate code below.The common configurations are:Australia:●To search all verified Australian addresses(including PO Box address types):{"address_params":{"source":"gnaf,paf"}}●To search only Australia Post delivered addresses(including PO Box address types):{"address_params":{"source":"paf"}}●To search only Australia Post delivered addresses(excluding PO Box address types):{"address_params":{"source":“paf","post_box":"0"}}New Zealand:●To search all verified New Zealand addresses(including PO Box address types):{"address_params":{}}●To search all verified New Zealand addresses(excluding PO Box address types):{"address_params":{"post_box":"0"}}For a full list of possible options visithttps://addressfi.au/docs/javascript_widget_reference_au/or contact us if you have any different needs.Disabling the service on specific formsBy default,the service will work in the Checkout,New Account,Edit Account and Admin Order pages(excluding Magento Version2.1).If you do not wish the service to work on all of these forms,disable the appropriate ones via the‘Enable Specific Forms’area found in:Stores> Settings>Configuration>Services>Addressfinder page.。

如何用Swift进行iOS应用国际化和本地化

如何用Swift进行iOS应用国际化和本地化

如何用Swift进行iOS应用国际化和本地化iOS应用国际化和本地化是一项重要的开发技巧,它允许开发者将应用适配到不同的语言和地区,以提供更好的用户体验。

本文将介绍如何使用Swift进行iOS应用的国际化和本地化。

1. 准备工作在开始国际化和本地化之前,需要在项目中为不同语言创建相应的本地化文件。

首先,选择项目导航器中的项目文件,然后在TARGETS 下选择工程名,进入Info选项卡。

在Localizations部分点击加号,选择相应的语言。

添加完成后,Xcode会自动生成对应的本地化文件。

2. 设置默认语言在项目文件导航器中找到InfoPlist.strings文件,打开后,在Identity and Type选项中选择"Localizable String"。

然后点击Localize按钮,勾选需要本地化的语言。

3. 创建本地化字符串文件在项目文件导航器中,右键点击默认的InfoPlist.strings文件,选择New File。

在弹出的模板选择框中,选择Strings File,并命名为Localizable.strings。

重复上述步骤,为每种语言创建对应的本地化字符串文件。

4. 添加本地化字符串打开Localizable.strings文件,在文件中添加需要本地化的字符串。

以键值对的形式添加,例如:"welcome" = "欢迎";"goodbye" = "再见";可以根据需要添加更多的本地化字符串。

5. 使用本地化字符串在开发阶段,可以使用NSLocalizedString函数来使用本地化字符串。

例如,将视图控制器的标题设置为Localizable.strings文件中的"welcome"字符串:self.title = NSLocalizedString("welcome", comment: "")6. 提取界面文字为了方便提取界面中的文字进行本地化,可以使用genstrings命令行工具,它会根据代码中的NSLocalizedString函数提取字符串到Localizable.strings文件中。

如何安装Xcode并开始iOS开发

如何安装Xcode并开始iOS开发

一、Xcode:一切iOS开发的起点随着移动互联网的快速发展,iOS开发成为了一个备受关注的领域。

而要想进行iOS开发,首先需要安装一个名叫Xcode的开发工具。

本文将介绍如何安装Xcode并开始iOS开发,并分享一些相关的实用技巧和资源,希望对广大初学者有所帮助。

二、安装Xcode:从Mac App Store到下载安装包要安装Xcode,首先需要一台Mac电脑,并且在Mac App Store中搜索“Xcode”,然后点击“获取”按钮进行下载和安装。

下载完成后,Xcode将出现在你的应用程序文件夹中。

如果你无法通过AppStore下载Xcode,可以尝试从苹果开发者网站上下载安装包。

只需登录你的开发者账号,点击下载按钮,然后按照指引进行安装即可。

三、启动Xcode:跟随向导设置开发环境安装完成后,你可以点击应用程序文件夹中的Xcode图标来启动它。

首次启动Xcode时,你将看到一个欢迎界面和一些设置选项。

按照向导的指引,你可以选择默认的布局和主题。

在这里,你还可以绑定你的Apple开发者账号,以便在Xcode中进行真机调试和发布应用。

四、进行iOS项目的创建和配置启动Xcode后,你可以开始创建一个新的iOS项目。

在菜单中选择“File”>“New”>“Project”,然后选择“iOS”>“App”,接下来你可以选择应用的模板和名称。

在这一步中,你还可以选择项目的存储位置、保留或移除版本控制和自动生成信息等。

五、熟悉Xcode的界面和功能熟悉Xcode的界面和功能对于进行iOS开发至关重要。

Xcode的界面由多个面板组成,如编辑器、导航器、助理编辑器、控制台等。

编辑器是你编写和修改代码的地方,导航器则用于查看项目的文件和目录结构。

助理编辑器可以用来查看和修改某个特定文件的相关信息。

控制台则用于显示应用的运行日志和调试信息。

六、编写和调试代码:理解Objective-C和SwiftiOS开发支持两种主要编程语言:Objective-C和Swift。

AddressFinder 安装指南说明书

AddressFinder 安装指南说明书

Installation GuideThere are a number of ways to install AddressFinder into your Magento 2.1, 2.2 or 2.3 website. We suggest you install via composer and the steps below outline this process.Step 1Open terminal \ console, go to your Magento installation directory and enter:composer require addressfinder/module-magento2This installs the AddressFinder plugin within Magento. Takes about five minutes.Step 2Once installation is completed, enable the AddressFinder module by entering:bin/magento module:enable AddressFinder_AddressFinderStep 3Run the setup:upgrade command:bin/magento setup:upgradeStep 4Clear the cache:bin/magento cache:flushStep 5 (optional)You may need to recompile your dependency injection cache and redeploy themes, especially in production. This process, which varies from site to site and is outside the context of installing this module, generally involves the commands:bin/magento setup:di:compilebin/magento setup:static-content:deployStep 6Configure the plugin within the Magento Admin settings.Go to S tores > Settings > Configuration > Services > AddressFinder1.Uncheck the 'U se system value' checkbox2.Set‘E nabled’ to Y es3.Enter your AddressFinder licence key h ttps:///signup/au/au_free54.Paste any address params into the ‘Widget Options’ area (optional)5.Save ConfigStep 7Test the service prior to deploying in order to ensure it is working correctly and not impacted by any conflicting plugins or website customisations.。

iOS开发中的Framework与CocoaPods

iOS开发中的Framework与CocoaPods

iOS开发中的Framework与CocoaPods在iOS开发中,Framework以及CocoaPods都是非常重要的概念。

这两个概念虽然非常简单,但是在实际开发中的作用却非常大。

一、FrameworkFramework可以理解为一种可复用的库,它提供了一些常用的功能供程序员使用。

在开发中,我们可以通过Framework实现代码的模块化,减少代码的冗余,提高了代码复用率,同时也有助于代码的维护和更新。

在iOS开发中,系统自带了很多的Framework,如UIKit、Foundation等,而我们自己开发的Framework也可以被其他人使用。

例如,在开发过程中,我们经常会用到第三方库。

有些时候,这些第三方库并没有源码或者源码并不是我们需要的,这时候我们就可以使用Framework。

有了Framework,我们可以将这些第三方库快速加入我们的工程中,同时也不用担心版本冲突等问题。

二、CocoaPodsCocoaPods可以理解为一个管理第三方库的工具,它可以让我们更轻松地管理第三方库。

使用CocoaPods,我们可以自动下载、配置和安装第三方库,同时也可以自动集成依赖库,并且保证版本的一致性。

CocoaPods源于Ruby开发语言,所以我们需要在安装CocoaPods之前先安装Ruby。

在安装完Ruby之后,我们可以通过终端命令安装CocoaPods,具体的命令如下:```$ sudo gem install cocoapods```安装完成之后,我们可以通过Podfile文件配置需要使用的第三方库,例如:```target 'MyApp' dopod 'AFNetworking', '~> 2.0'pod 'Reachability', '~> 3.0'end```这个Podfile文件告诉CocoaPods,我们需要使用AFNetworking和Reachability这两个第三方库,并且需要保证它们的版本是2.0和3.0及以上。

iOS打包framework-Swift完整项目打包Framework,嵌入OC项目使用

iOS打包framework-Swift完整项目打包Framework,嵌入OC项目使用

iOS打包framework-Swift完整项⽬打包Framework,嵌⼊OC项⽬使⽤场景说明:-之前做的App,使⽤Swift框架语⾔,混合编程,内含少部分OC代码。

-需要App整体功能打包成静态库,完整移植到另⼀个App使⽤,该App使⽤OC。

-所以涉及到⼀个语⾔互转的处理,以及⼀些AppDelegate的代码减除变化。

--------------------------------打包篇-------------------------------实现步骤:⼀、新建 Project - Framework&Library - Cocoa Touch Framework,Next 语⾔选择Swift建⽴完成,会看到默认⽣成的⼀个 xxx.h 和 Info.plist ⽂件(只看红框内)。

解释⼀下这两个⽂件:1 xxx.h ⽂件的作⽤是整个包对外提供的⼊⼝头⽂件,除了正常定义参数属性之外,还有1、提供 Swift项⽬内引⽤的OC⽂件的import引⽤,注意,这⾥引⽤之前必须在Build Phrases的Headers内暴露到 Public,见步骤六2、提供第三⽅⽂件的import引⽤,这⾥的第三⽅管理,我们依然选择使⽤Pods管理,下⽂会具体描述。

以上两部完成后,举例效果图:2 info.plist ⽂件的作⽤就如同正常项⽬的plist⽂件作⽤,⽤来定义或添加⼀些属性。

⼆、添加⽂件,这⾥可以⾃⼰新建,或者从已有项⽬拷贝过来都可以。

这⾥要注意⼀下:由于打包类库⼯程不是⼀个完整项⽬⼯程,所以并没有AppDelegate等⽂件,所以涉及到这些的⽂件要额外处理,或改代码,或适当改变功能。

注意:⼯程如果有桥接⽂件,是不能拷贝过来的,否则编译不通过。

原因见步骤五。

三、如果有第三⽅类库引⽤,添加第三⽅库⽂件,有⼏个注意点:(没有第三⽅可以跳过这步)a、第三⽅库依然使⽤Pods进⾏管理,添加⽅法同正常项⽬⼀样。

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Address Book Framework Reference for iOSContentsIntroduction5Opaque Types6ABAddressBook Reference7 Overview7Functions by Task7Functions8Callbacks17Data Types18Constants19ABMultiValue Reference22 Overview22Functions by Task22Functions23Data Types28Constants29ABMutableMultiValue Reference30 Overview30Functions by Task30Functions31Data Types36ABRecord Reference38Overview38Functions by Task38Functions39Data Types43Constants45Other References49ContentsABGroup Reference50 Overview50Functions by Task50Functions51Constants57ABPerson Reference59 Overview59Functions by Task59Functions61Data Types75Constants76ABSource Reference92 Overview92Functions92Data Types94Constants94Document Revision History97ListingsABAddressBook Reference7Listing1-‐1Sample implementation using ABAddressBookRequestAccessCompletionHandler18IntroductionFramework/System/Library/Frameworks/AddressBook.frameworkHeader file directories/System/Library/Frameworks/AddressBook.framework/HeadersDeclared in ABAddressBook.hABGroup.hABMultiValue.hABPerson.hABRecord.hABSource.hThe Address Book framework provides access to a centralized contacts database,called the Address Book database,that stores a user’s contacts.Applications such as Mail and Messages use this database to present information about known and unknown persons.Opaque TypesABAddressBook ReferenceDerived from CFTypeRefFramework AddressBook/AddressBook.hDeclared in ABAddressBook.hOverviewThe ABAddressBook opaque type(whose instances are known as address books)provides a programming interface to the Address Book—a centralized database used by multiple applications to store personal information about people.The Address Book database also supports the notion of a“group”containing one or more persons.People may belong to multiple groups,and groups may also belong to other groups.The ABAddressBook opaque type provides functions for creating references to the Address Book database, saving changes,discarding changes,and registering for changes made externally(by other threads or processes) to the database.Functions by TaskManaging Address BooksABAddressBookCreate (page 10)Creates a new address book object with data from the Address Book database.(e the ABAddressBookCreateWithOptions (page 10)function instead.) ABAddressBookCreateWithOptions (page 10)Creates a new address book object with data from the Address Book database. ABAddressBookGetAuthorizationStatus (page 11)Returns the authorization status of your app for accessing address book data. ABAddressBookRequestAccessWithCompletion (page 14)Requests access to address book data from the user.ABAddressBookHasUnsavedChanges (page 12)Indicates whether an address book has changes that have not been saved to the Address Book database. ABAddressBookSave (page 15)Saves any unsaved changes to the Address Book database.ABAddressBookRevert (page 15)Discards unsaved changes in an address book.Managing Address Book RecordsABAddressBookAddRecord (page 8)Adds a record to an address book.ABAddressBookRemoveRecord (page 13)Removes a record from an address book.Getting Address Book Change Notifications ABAddressBookRegisterExternalChangeCallback (page 12)Registers a callback to receive notifications when the Address Book database is modified. ABAddressBookUnregisterExternalChangeCallback (page 16)Unregisters a callback.Localizing TextABAddressBookCopyLocalizedLabel (page 9)Returns a localized version of a record-‐property label.FunctionsABAddressBookAddRecordAdds a record to an address book.bool ABAddressBookAddRecord(ABAddressBookRef addressBook,ABRecordRef record,CFErrorRef*error);ParametersaddressBookThe address book to which record is added.recordThe record to add to addressBook.errorOn error,contains error information.See“Address Book Errors” (page 21).Return Valuetrue when successful,false otherwise.AvailabilityAvailable in iOS2.0and later.Related Sample CodeABUIGroupsDeclared inABAddressBook.hABAddressBookCopyLocalizedLabelReturns a localized version of a record-property label.CFStringRef ABAddressBookCopyLocalizedLabel(CFStringRef label);ParameterslabelThe label to localize.Return ValueThe label localized to the user’s locale.AvailabilityAvailable in iOS2.0and later.Declared inABAddressBook.hABAddressBookCreateCreates a new address book object with data from the Address Book database.(Deprecated in e the ABAddressBookCreateWithOptions (page 10)function instead.)ABAddressBookRef ABAddressBookCreate(void);Return ValueAn address book object.DiscussionChanges made to the returned address book are reflected in the Address Book database only after saving the address book with ABAddressBookSave (page 15).Important: You must ensure that an instance of ABAddressBookRef is used by only one thread.AvailabilityAvailable in iOS2.0and later.Deprecated in iOS6.0.Declared inABAddressBook.hABAddressBookCreateWithOptionsCreates a new address book object with data from the Address Book database.ABAddressBookRef ABAddressBookCreateWithOptions(CFDictionaryRef options,CFErrorRef*error);ParametersoptionsReserved.Pass NULL.errorOn error,contains error information.See“Address Book Errors” (page 21).Return ValueAn address book object,NULL,or an empty database.DiscussionChanges made to the returned address book are reflected in the Address Book database only after saving the address book with ABAddressBookSave (page 15).On iOS6.0and later,if the caller does not have access to the Address Book database:●For apps linked against iOS6.0and later,this function returns NULL.●For apps linked against previous version of iOS,this function returns an empty read-‐only database.If your app syncs information with the database,it must not sync data when it does not have access to the database.Important: You must ensure that an instance of ABAddressBookRef is used by only one thread.AvailabilityAvailable in iOS6.0and later.Related Sample CodeABUIGroupsChecking and Requesting Access to Data Classes in Privacy SettingsQuickContactsDeclared inABAddressBook.hABAddressBookGetAuthorizationStatusReturns the authorization status of your app for accessing address book data.ABAuthorizationStatus ABAddressBookGetAuthorizationStatus(void);Return ValueThe authorization status for your app.AvailabilityAvailable in iOS6.0and later.Related Sample CodeABUIGroupsChecking and Requesting Access to Data Classes in Privacy SettingsQuickContactsDeclared inABAddressBook.hABAddressBookHasUnsavedChangesIndicates whether an address book has changes that have not been saved to the Address Book database.bool ABAddressBookHasUnsavedChanges(ABAddressBookRef addressBook);ParametersaddressBookThe address book in question.Return Valuetrue when addressBook contains unsaved changes,false otherwise.AvailabilityAvailable in iOS2.0and later.Declared inABAddressBook.hABAddressBookRegisterExternalChangeCallbackRegisters a callback to receive notifications when the Address Book database is modified.void ABAddressBookRegisterExternalChangeCallback(ABAddressBookRef addressBook,ABExternalChangeCallback callback,void*context);ParametersaddressBookThe address book used to interact with the Address Book database. callBackThe function to invoke when the Address Book database changes. contextThe object to pass to the callback function.AvailabilityAvailable in iOS2.0and later.See AlsoABExternalChangeCallback (page 17) ABAddressBookUnregisterExternalChangeCallback (page 16)Related Sample CodeChecking and Requesting Access to Data Classes in Privacy SettingsDeclared inABAddressBook.hABAddressBookRemoveRecordRemoves a record from an address book.bool ABAddressBookRemoveRecord(ABAddressBookRef addressBook,ABRecordRef record,CFErrorRef*error);ParametersaddressBookThe address book from which record is to be removed.recordThe record to remove from addressBook.errorOn error,contains error information.See“Address Book Errors” (page 21). Return Valuetrue when successful,false otherwise.AvailabilityAvailable in iOS2.0and later.Related Sample CodeABUIGroupsDeclared inABAddressBook.hABAddressBookRequestAccessWithCompletionRequests access to address book data from the user.void ABAddressBookRequestAccessWithCompletion(ABAddressBookRef addressBook,ABAddressBookRequestAccessCompletionHandler completion);ParametersaddressBookThe address book in question.completionThe completion handler,called once access has been granted or denied by the user.DiscussionUse this function to request access to address book data.This call will not block while the user is being asked for access,allowing your app to continue running.Until access has been granted,any address book references your app has will not contain any data,and any attempt to modify data will fail with an error type of kABOperationNotPermittedByUserError (page 21).The user is only asked for permission the first time you request ter calls use the permission granted by the user.The completion handler is called on an arbitrary queue.If your app uses an address book throughout the app, you are responsible for ensuring that all usage of that address book is dispatched to a single queue to ensure correct thread-‐safe operation.AvailabilityAvailable in iOS6.0and later.Related Sample CodeABUIGroupsChecking and Requesting Access to Data Classes in Privacy SettingsQuickContactsDeclared inABAddressBook.hABAddressBookRevertDiscards unsaved changes in an address book.void ABAddressBookRevert(ABAddressBookRef addressBook);ParametersaddressBookThe address book to revert.DiscussionThe address book is loaded with the information in the Address Book database.AvailabilityAvailable in iOS2.0and later.Declared inABAddressBook.hABAddressBookSaveSaves any unsaved changes to the Address Book database.bool ABAddressBookSave(ABAddressBookRef addressBook,CFErrorRef*error);ParametersaddressBookThe address book to save.errorOn error,contains error information.See“Address Book Errors” (page 21).Return Valuetrue when successful,false otherwise.AvailabilityAvailable in iOS2.0and later.Related Sample CodeABUIGroupsDeclared inABAddressBook.hABAddressBookUnregisterExternalChangeCallbackUnregisters a callback.void ABAddressBookUnregisterExternalChangeCallback(ABAddressBookRef addressBook,ABExternalChangeCallback callback,void*context);ParametersaddressBookThe address book used to interact with the Address Book database.callBackThe function to invoke when the Address Book database changes.The signature of the function must match ABExternalChangeCallback (page 17).contextThe object to pass to the callback function.AvailabilityAvailable in iOS2.0and later.See AlsoABExternalChangeCallback (page 17) ABAddressBookRegisterExternalChangeCallback (page 12)Related Sample CodeChecking and Requesting Access to Data Classes in Privacy SettingsDeclared inABAddressBook.hCallbacksABExternalChangeCallbackPrototype for a function callback invoked on an address book when the Address Book database is modified by another address book instance.typedef void(*ABExternalChangeCallback)(ABAddressBookRef addressBook,CFDictionaryRef info,void*context);If you name your callback function MyAddressBookExternalChangeCallback,you declare it like this:void MyAddressBookExternalChangeCallback(ABAddressBookRef addressBook,CFDictionaryRef info,void*context);ParametersaddressBookAn address book used to interact with the Address Book database.infoAlways NULL.contextThe object to pass to the callback function.DiscussionUse ABAddressBookRegisterExternalChangeCallback (page 12)to register and ABAddressBookUnregisterExternalChangeCallback (page 16)to unregister the callback function.You can register for a callback with different contexts or callback functions.The run loop on the thread that registered the callback invokes the callback.The addressBook object does not take any action to flush or synchronize cached state with the Address Book database.If you want to ensure that addressBook doesn’t contain stale values,use ABAddressBookRevert (page 15).AvailabilityAvailable in iOS2.0and later.Declared inABAddressBook.hData TypesABAddressBookRefReference to an object used to interact with the Address Book database.typedef CFTypeRef ABAddressBookRef;AvailabilityAvailable in iOS2.0and later.Declared inABAddressBook.hABAddressBookRequestAccessCompletionHandlerDefinition for a block callback invoked when an access request has completed.typedef void(^ABAddressBookRequestAccessCompletionHandler)(bool granted,CFErrorRef error);DiscussionAddress book request access completion handler blocks are used with ABAddressBookCreateWithOptions (page 10).If you had a view controller that wanted to display the count of users with the name“Smith”in the address book,you might implement something like the code shown in the following code listing.Listing1-1Sample implementation using ABAddressBookRequestAccessCompletionHandler@implementation APLViewController-(void)viewDidLoad{[super viewDidLoad];//Do any additional setup after loading the viewCFErrorRef myError=NULL;ABAddressBookRef myAddressBook=ABAddressBookCreateWithOptions(NULL,&myError);APLViewController*__weak weakSelf=self;//avoid capturing self in the blockABAddressBookRequestAccessWithCompletion(myAddressBook,^(bool granted,CFErrorRef error){if(granted){NSArray*theSmiths=CFBridgingRelease(ABAddressBookCopyPeopleWithName(myAddressBook,CFSTR("Smith")));weakSelf.numberOfSmiths=[theSmiths count];}else{//Handle the case of being denied access and/or the error.}CFRelease(myAddressBook);});}...@endAvailabilityAvailable in iOS6.0and later.Declared inABAddressBook.hConstantsAddress Book Error DomainError domain under which Address Book errors are grouped.const CFStringRef ABAddressBookErrorDomain;ConstantsABAddressBookErrorDomainThe main error domain for Address Book framework operations.Available in iOS2.0and later.Declared in ABAddressBook.h.ABAuthorizationStatusDifferent possible values for the authorization status of an app with respect to address book data.typedef CF_ENUM(CFIndex,ABAuthorizationStatus){kABAuthorizationStatusNotDetermined=0,kABAuthorizationStatusRestricted,kABAuthorizationStatusDenied,kABAuthorizationStatusAuthorized};ConstantskABAuthorizationStatusNotDeterminedNo authorization status could be determined.Available in iOS6.0and later.Declared in ABAddressBook.h.kABAuthorizationStatusRestrictedThe app is not authorized to access address book data.The user cannot change this access,possibly due to restrictions such as parental controls.Available in iOS6.0and later.Declared in ABAddressBook.h.kABAuthorizationStatusDeniedThe user explicitly denied access to address book data for this app.Available in iOS6.0and later.Declared in ABAddressBook.h.kABAuthorizationStatusAuthorizedThe app is authorized to access address book data.Available in iOS6.0and later.Declared in ABAddressBook.h.ABAddressBook ReferenceConstantsAddress Book ErrorsErrors that can be raised under the Address Book error domain.enum{kABOperationNotPermittedByStoreError=0,kABOperationNotPermittedByUserError};ConstantskABOperationNotPermittedByStoreErrorThe operation is not allowed by the Address Book database,because the contact’s source does not support it.Available in iOS2.0and later.Declared in ABAddressBook.h.kABOperationNotPermittedByUserErrorThe operation is not allowed because the user denied access to the Address Book database.Available in iOS6.0and later.Declared in ABAddressBook.h.ABMultiValue ReferenceDerived from CFTypeRefFramework AddressBook/AddressBook.hDeclared in ABMultiValue.hOverviewThe ABMultiValue opaque type(whose objects are known as multivalues)implements a property that can have multiple values.All the contained values must be of the same type.Each value has a unique identifier and a nonunique label,which may be one of the provided labels or one defined by the user.For example,if a multivalue property is used to store phone numbers,there may be multiple work phone numbers.These have the same label,but different unique identifiers.Multivalue properties are immutable.To use mutable multivalue properties,see ABMutableMultiValue Reference.Functions by TaskGetting Values and LabelsABMultiValueCopyValueAtIndex (page 24)Returns the value at a particular location within a multivalue property. ABMultiValueCopyArrayOfAllValues (page 23)Returns an array with the values in a multivalue property.ABMultiValueGetCount (page 25)Returns the number of values in a multivalue property. ABMultiValueGetFirstIndexOfValue (page 26)Returns the first location of a value in a multivalue property.ABMultiValueCopyLabelAtIndex (page 24)Returns the label for a value in a multivalue property.Getting Value IdentifiersABMultiValueGetIdentifierAtIndex (page 26)Returns the identifier of a value in a multivalue property. ABMultiValueGetIndexForIdentifier (page 27)Returns the location(within a multivalue property)of a value with a given identifier. Getting Property InformationABMultiValueGetPropertyType (page 27)Returns the type of the values contained in a multivalue property.FunctionsABMultiValueCopyArrayOfAllValuesReturns an array with the values in a multivalue property.CFArrayRef ABMultiValueCopyArrayOfAllValues(ABMultiValueRef multiValue);ParametersmultiValueThe multivalue property whose values are being return.Return ValueArray containing the values in multiValue.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueCopyLabelAtIndexReturns the label for a value in a multivalue property.CFStringRef ABMultiValueCopyLabelAtIndex(ABMultiValueRef multiValue,CFIndex index);ParametersmultiValueThe multivalue property with the value whose label to return.indexLocation of the value within multiValue whose label to return.Raises an exception when out of bounds.Return ValueLabel for the value at index within multiValue.DiscussionIf there is no label for the value at index,returns NULL.This function takes an index.If you have an identifier,use the ABMultiValueGetIndexForIdentifier (page 27)function to get the corresponding index.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueCopyValueAtIndexReturns the value at a particular location within a multivalue property.CFTypeRef ABMultiValueCopyValueAtIndex(ABMultiValueRef multiValue,CFIndex index);ParametersmultiValueThe multivalue property from which to obtain the value.indexLocation of the desired value within multiValue.Raises an exception when out of bounds.Return ValueThe value at index in multiValue.DiscussionThis function takes an index.If you have an identifier,use the ABMultiValueGetIndexForIdentifier (page 27)function to get the corresponding index.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueGetCountReturns the number of values in a multivalue property.CFIndex ABMultiValueGetCount(ABMultiValueRef multiValue);ParametersmultiValueThe multivalue property whose value are being counted.Return ValueThe number of values in multiValue.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueGetFirstIndexOfValueReturns the first location of a value in a multivalue property.CFIndex ABMultiValueGetFirstIndexOfValue(ABMultiValueRef multiValue,CFTypeRef value);ParametersmultiValueThe multivalue property in which to search for value.valueThe value to search for in multiValue.Return ValueLocation of value within multiValue,-1if value is not present in multiValue.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueGetIdentifierAtIndexReturns the identifier of a value in a multivalue property.ABMultiValueIdentifier ABMultiValueGetIdentifierAtIndex( ABMultiValueRef multiValue,CFIndex index);ParametersmultiValueThe multivalue property with the identifier to return.indexLocation of the value within multiValue whose identifier is being returned.Return ValueIdentifier of the value at index within multiValue.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueGetIndexForIdentifierReturns the location(within a multivalue property)of a value with a given identifier. CFIndex ABMultiValueGetIndexForIdentifier(ABMultiValueRef multiValue,ABMultiValueIdentifier identifier);ParametersmultiValueThe multivalue property in which to look for the identifier value identifier.identifierThe identifier of the value whose location within multiValue is being returned.Return ValueLocation within multiValue that contains the value with identifier as its identifier.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueGetPropertyTypeReturns the type of the values contained in a multivalue property.ABPropertyType ABMultiValueGetPropertyType(ABMultiValueRef multiValue);ParametersmultiValueThe multivalue property whose type is being returned.Return ValueThe type of the values contained in multiValue or kABInvalidPropertyType when multiValue is empty or contains values of different types.AvailabilityAvailable in iOS2.0and later.See AlsoABMultiValueCreateMutable (page 32)Declared inABMultiValue.hData TypesABMultiValueRefReference to a multivalue property.typedef CFTypeRef ABMultiValueRef;AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueIdentifierIdentifies multivalue properties.typedef int32_t ABMultiValueIdentifier;DiscussionSee“Invalid Multivalue-Property Identifier” (page 29).AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hConstantsInvalid Multivalue-Property IdentifierThis preprocessor definition identifies an multivalue property with values whose type does not match its declared type.#define kABMultiValueInvalidIdentifier-1ConstantskABMultiValueInvalidIdentifierInvalid multivalue property.Available in iOS2.0and later.Declared in ABMultiValue.h.DiscussionSee ABMultiValueIdentifier (page 28).ABMutableMultiValue ReferenceDerived from CFTypeRefFramework AddressBook/AddressBook.hDeclared in ABMultiValue.hOverviewThe ABMutableMultiValue opaque type(whose objects are known as mutable multivalues)implements a mutable multivalue property—that is,a property whose value set can be modified.This opaque type extends the capabilities of ABMultiValue.Functions by TaskCreating PropertiesABMultiValueCreateMutable (page 32)Returns a new,empty,mutable multivalue property.Getting PropertiesABMultiValueCreateMutableCopy (page 32)Returns a mutable copy of a multivalue property.Managing Property ValuesABMultiValueAddValueAndLabel (page 31)Adds a value and its corresponding label to a multivalue property.ABMultiValueReplaceValueAtIndex (page 36)Replaces a value in a multivalue property with another value. ABMultiValueReplaceLabelAtIndex (page 35)Replaces a label in a multivalue property with another label. ABMultiValueInsertValueAndLabelAtIndex (page 33)Inserts a value and a label into a multivalue property. ABMultiValueRemoveValueAndLabelAtIndex (page 34)Removes a value from a multivalue property.FunctionsABMultiValueAddValueAndLabelAdds a value and its corresponding label to a multivalue property.bool ABMultiValueAddValueAndLabel(ABMutableMultiValueRef multiValue,CFTypeRef value,CFStringRef label,ABMultiValueIdentifier*outIdentifier);ParametersmultiValueThe multivalue property to add value and label to.valueThe value to add to multiValue.labelThe label for value.outIdentifierThe address at which to place the identifier of the added value.Pass NULL to ignore the identifier.Return Valuetrue when value is added to multiValue successfully,false otherwise.DiscussionThis function performs no type checking.It allows the addition of values whose type does not match the type declared for multiValue.AvailabilityAvailable in iOS2.0and later.See AlsoABMultiValueCreateMutable (page 32)Related Sample CodeQuickContactsDeclared inABMultiValue.hABMultiValueCreateMutableReturns a new,empty,mutable multivalue property.ABMutableMultiValueRef ABMultiValueCreateMutable( ABPropertyType type);ParameterstypeThe type of the values that the new property will contain. Return ValueAn empty multivalue property whose values will be of type type. AvailabilityAvailable in iOS2.0and later.See AlsoABMultiValueGetPropertyType (page 27)Related Sample CodeQuickContactsDeclared inABMultiValue.h ABMultiValueCreateMutableCopyReturns a mutable copy of a multivalue property.ABMutableMultiValueRef ABMultiValueCreateMutableCopy( ABMultiValueRef multiValue);ParametersmultiValueThe multivalue property being copied.Return ValueA mutable copy of multiValue.AvailabilityAvailable in iOS2.0and later.Declared inABMultiValue.hABMultiValueInsertValueAndLabelAtIndexInserts a value and a label into a multivalue property.bool ABMultiValueInsertValueAndLabelAtIndex(ABMutableMultiValueRef multiValue,CFTypeRef value,CFStringRef label,CFIndex index,ABMultiValueIdentifier*outIdentifier);ParametersmultiValueThe multivalue property into which to insert value.valueThe value to insert.labelThe label to insert.indexThe location,in multiValue,at which to insert value and label.Raises an exception when out of bounds.outIdentifierOn output,the identifier of the added value.Return Valuetrue when value and label are inserted successfully into multiValue,false otherwise.DiscussionThis function performs no type checking.It allows the insertion of values whose type does not match the type declared for multiValue.This function takes an index.If you have an identifier,use the ABMultiValueGetIndexForIdentifier (page 27)function to get the corresponding index.AvailabilityAvailable in iOS2.0and later.See AlsoABMultiValueCreateMutable (page 32)Declared inABMultiValue.hABMultiValueRemoveValueAndLabelAtIndexRemoves a value from a multivalue property.bool ABMultiValueRemoveValueAndLabelAtIndex(ABMutableMultiValueRef multiValue,CFIndex index);ParametersmultiValueThe multivalue property from which to remove the value at index.indexThe location,in multiValue,of the value being removed.Raises an exception when out of bounds.Return Valuetrue when successful,false otherwise.。

相关文档
最新文档