Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DOCSP-14655): Port current limitations to iOS sections #1026

Merged
merged 5 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/includes/string-sort-and-query-limitations-note.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. note::

String sorting and case-insensitive queries are only supported for
character sets in 'Latin Basic', 'Latin Supplement', 'Latin Extended
A', and 'Latin Extended B' (UTF-8 range 0-591).
20 changes: 20 additions & 0 deletions source/sdk/ios/data-types/supported-property-types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Property Cheat Sheet
``CGFloat`` properties are discouraged, as the type is not
platform independent.


Unique Identifiers
------------------

Expand Down Expand Up @@ -202,3 +203,22 @@ When using the ``AnyRealmValue`` mixed data type, keep these things in mind:
- String properties do not match numeric queries. For example, in a mixed
type field, 1 does not match "1". "1" does not match 1, 1.0, or true.

.. _ios-size-limitations:

Size Limitations
----------------

Data and string properties cannot hold more than 16MB. To store
larger amounts of data, either:

- Break the data into 16MB chunks, or
- Store data directly on the file system and store paths to the files in the {+realm+}.

{+service-short+} throws a runtime exception if your app attempts to
store more than 16MB in a single property.

To avoid size limitations and a performance impact, it is best not to
store large blobs, such as image and video files, directly in a
{+realm+}. Instead, save the file to a file store and keep only the
location of the file and any relevant metadata in the {+realm+}.

8 changes: 8 additions & 0 deletions source/sdk/ios/examples/define-a-realm-object-model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Define a New Object Type
.. literalinclude:: /examples/generated/code/start/ObjectModels.codeblock.define-a-model.m
:language: objectivec

.. note::

Class names are limited to a maximum of 57 UTF-8 characters.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: implies that there is no limit if you don't use UTF-8 encoding.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it? How would you write around this?


.. _ios-declare-a-property:

Declare Properties
Expand Down Expand Up @@ -90,6 +94,10 @@ Declare Properties
.. literalinclude:: /examples/generated/code/start/ObjectModels.codeblock.array-declaration.m
:language: objectivec

.. note::

Property names are limited to a maximum of 63 UTF-8 characters.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


.. _ios-specify-an-optional-required-property:

Specify an Optional/Required Property
Expand Down
1 change: 1 addition & 0 deletions source/sdk/ios/examples/filter-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ Regex-like wildcards allow more flexibility in search.
.. literalinclude:: /examples/generated/code/start/QueryEngine.codeblock.string-operators.swift
:language: swift

.. include:: /includes/string-sort-and-query-limitations-note.rst

Aggregate Operators
~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion source/sdk/ios/examples/read-and-write-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ guarantees a consistent order of results if you explicitly sort them.
<Classes/RLMResults.html#/c:objc(cs)RLMResults(im)sortedResultsUsingKeyPath:ascending:>`
with the desired key path to sort by.


.. literalinclude:: /examples/generated/code/start/ReadWriteData.codeblock.sort.m
:language: objectivec

Expand All @@ -202,6 +201,8 @@ guarantees a consistent order of results if you explicitly sort them.
<ios-declare-relationship-properties>`, use dot-notation as if it
were in a regular, nested object.

.. include:: /includes/string-sort-and-query-limitations-note.rst

.. _ios-query-a-relationship:

Query a Relationship
Expand Down
11 changes: 10 additions & 1 deletion source/sdk/ios/fundamentals/realms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,19 @@ comparable SQLite database. Unexpected file growth may be related to the
.. tip:: Avoid pinning old Realm transactions

{+backend-short+} ties read transaction lifetimes to the memory lifetime
of {+backend-short+} instances. Avoid pinning old Realm transactions.
of {+backend-short+} instances. Avoid "pinning" old Realm transactions.
Use auto-refreshing {+backend-short+}s, and wrap the use of Realm APIs
from background threads in explicit autorelease pools.

.. note::

A large {+realm+} file can impact the performance and reliability of
your app. Any single {+realm+} file cannot be larger than the amount
of memory your application would be allowed to map in iOS. This limit
depends on the device and on how fragmented the memory space is at
that point in time. If you need to store more data, you can map it
over multiple {+realm+} files.

Threading
~~~~~~~~~

Expand Down