Skip to content

Commit

Permalink
doc: grammar teaks to docs/sources/foundation_eg.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-CODE committed Apr 16, 2016
1 parent 6e34d24 commit c11006f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/source/foundation_eg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Foundation framework examples

.. module:: pyobjus

This part of the documentation covers examples of using classes from foundation framework.
This part of the documentation covers examples of using classes from the
`Foundation framework
<https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/ObjC_classic/>`_.

NSArray example
---------------

Here is an example of using NSArray class::
Here is an example of using the NSArray class::

from pyobjus import autoclass

Expand Down Expand Up @@ -38,22 +40,23 @@ This will output::
NSArray with pyobjus literals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want, you can use sommething like Objective C literals to create NSArray::
If you want, you can use something like an Objective C literal to create an
NSArray::

from pyobjus import objc_arr, objc_str

array = objc_arr(objc_str('some string'), objc_str('some other string'))
print array

As you can see here, ``objc_arr(...)`` is equvivalent to ``autoclass('NSArray').arrayWithObjects_(...)``,
and this will output::
As you can see here, ``objc_arr(...)`` is equivalent to
``autoclass('NSArray').arrayWithObjects_(...)``, and will output::

>>> <__main__.__NSArrayI object at 0x10a22d350>

NSDictionary example
--------------------

Here is an example of using NSDictoinary class::
Here is an example of using a NSDictionary class::

from pyobjus import autoclass

Expand Down Expand Up @@ -81,9 +84,11 @@ This will output::
NSDictionary with pyobjus literals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We can use pyobjus `literals` also with NSDictionary class.
We can also use pyobjus `literals` with the NSDictionary class.

So let's add two elements to dictionary. The first one has key 'first_key', and value @'string value of first key', and the second one has key 'second_key', with value NSArray::
So let's add two elements to the dictionary. The first one has the key
'first_key' and the value @'string value of first key', and the second one has
the key 'second_key' with the value NSArray::

from pyobjus import objc_dict, objc_str, objc_arr

Expand Down

0 comments on commit c11006f

Please sign in to comment.