XCode 4.6.3 を使用して、iOS の「hello world」のようなアプリケーションを試しています。CTRL + ドラッグを使用して UI 要素のアクションを作成できます。私の質問は、XCode がどのメソッドが特定の要素に関連付けられているかをどのように追跡するかということです。にはそのような表示はありませんViewController.m
。
3 に答える
0
TextWrangler などのテキスト エディターで .storyboard を開くと、次のように表示されます。
<button opaque="NO" tag="395" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="5uG-EO-FFO">
<rect key="frame" x="791" y="86" width="105" height="77"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="button_image">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="buttonPressed:" destination="YWJ-As-K1q" eventType="touchDown" id="PXt-9J-VMA"/>
<action selector="buttonReleased:" destination="YWJ-As-K1q" eventType="touchUpInside" id="1QQ-SE-jT6"/>
<action selector="buttonReleased:" destination="YWJ-As-K1q" eventType="touchDragExit" id="nqM-R3-G1j"/>
</connections>
</button>
destination
= ビュー コントローラー - メソッドのターゲット 'selector' = メソッドの名前
<viewController id="YWJ-As-K1q" customClass="SomeViewController" sceneMemberID="viewController">
それで全部です。
于 2013-11-14T07:25:20.553 に答える